@@ -7,6 +7,7 @@ import * as crypto from 'crypto';
77import {
88 DebugSessionOptions ,
99 Disposable ,
10+ EnvironmentVariableMutatorOptions ,
1011 GlobalEnvironmentVariableCollection ,
1112 env ,
1213 l10n ,
@@ -37,6 +38,9 @@ export async function registerNoConfigDebug(
3738 extPath : string ,
3839) : Promise < Disposable > {
3940 const collection = envVarCollection ;
41+ const shellIntegrationMutatorOptions : EnvironmentVariableMutatorOptions = {
42+ applyAtShellIntegration : true ,
43+ } ;
4044
4145 // create a temp directory for the noConfigDebugAdapterEndpoints
4246 // file path format: extPath/.noConfigDebugAdapterEndpoints/endpoint-<sessionId>.txt
@@ -60,19 +64,19 @@ export async function registerNoConfigDebug(
6064 collection . clear ( ) ;
6165
6266 // Add env var for PYDEVD_DISABLE_FILE_VALIDATION to disable extra output in terminal when starting the debug session.
63- collection . replace ( 'PYDEVD_DISABLE_FILE_VALIDATION' , '1' ) ;
67+ collection . replace ( 'PYDEVD_DISABLE_FILE_VALIDATION' , '1' , shellIntegrationMutatorOptions ) ;
6468
6569 // Add env vars for VSCODE_DEBUGPY_ADAPTER_ENDPOINTS, BUNDLED_DEBUGPY_PATH, and PATH
66- collection . replace ( 'VSCODE_DEBUGPY_ADAPTER_ENDPOINTS' , tempFilePath ) ;
70+ collection . replace ( 'VSCODE_DEBUGPY_ADAPTER_ENDPOINTS' , tempFilePath , shellIntegrationMutatorOptions ) ;
6771
6872 const noConfigScriptsDir = path . join ( extPath , 'bundled' , 'scripts' , 'noConfigScripts' ) ;
6973 const pathSeparator = process . platform === 'win32' ? ';' : ':' ;
7074
7175 // Always prepend separator when appending to PATH since append() concatenates to existing value
72- collection . append ( 'PATH' , `${ pathSeparator } ${ noConfigScriptsDir } ` ) ;
76+ collection . append ( 'PATH' , `${ pathSeparator } ${ noConfigScriptsDir } ` , shellIntegrationMutatorOptions ) ;
7377
7478 const bundledDebugPath = path . join ( extPath , 'bundled' , 'libs' , 'debugpy' ) ;
75- collection . replace ( 'BUNDLED_DEBUGPY_PATH' , bundledDebugPath ) ;
79+ collection . replace ( 'BUNDLED_DEBUGPY_PATH' , bundledDebugPath , shellIntegrationMutatorOptions ) ;
7680
7781 envVarCollection . description = l10n . t (
7882 'Enables use of [no-config debugging](https://github.com/microsoft/vscode-python-debugger/wiki/No%E2%80%90Config-Debugging), `debugpy <script.py>`, in the terminal.' ,
0 commit comments