@@ -120,6 +120,10 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ
120120 this ,
121121 this . disposables ,
122122 ) ;
123+ const isActive = this . isShellIntegrationActive ( ) ;
124+ if ( ! isActive ) {
125+ traceWarn ( `Shell integration is not active, environment activated maybe overriden by the shell.` ) ;
126+ }
123127 this . registeredOnce = true ;
124128 }
125129 this . _applyCollection ( resource ) . ignoreErrors ( ) ;
@@ -153,13 +157,14 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ
153157 shell ,
154158 ) ;
155159 const env = activatedEnv ? normCaseKeys ( activatedEnv ) : undefined ;
160+ traceVerbose ( `Activated environment variables for ${ resource ?. fsPath } ` , env ) ;
156161 if ( ! env ) {
157162 const shellType = identifyShellFromShellPath ( shell ) ;
158163 const defaultShell = defaultShells [ this . platform . osType ] ;
159164 if ( defaultShell ?. shellType !== shellType ) {
160165 // Commands to fetch env vars may fail in custom shells due to unknown reasons, in that case
161166 // fallback to default shells as they are known to work better.
162- await this . _applyCollection ( resource , defaultShell ?. shell ) ;
167+ await this . _applyCollectionImpl ( resource , defaultShell ?. shell ) ;
163168 return ;
164169 }
165170 await this . trackTerminalPrompt ( shell , resource , env ) ;
@@ -352,6 +357,9 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ
352357 // https://code.visualstudio.com/docs/terminal/shell-integration#_automatic-script-injection
353358 return true ;
354359 }
360+ if ( isEnabled ) {
361+ traceVerbose ( 'Shell integrated is disabled in user settings.' ) ;
362+ }
355363 return false ;
356364 }
357365
0 commit comments