@@ -120,6 +120,10 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ
120
120
this ,
121
121
this . disposables ,
122
122
) ;
123
+ const isActive = this . isShellIntegrationActive ( ) ;
124
+ if ( ! isActive ) {
125
+ traceWarn ( `Shell integration is not active, environment activated maybe overriden by the shell.` ) ;
126
+ }
123
127
this . registeredOnce = true ;
124
128
}
125
129
this . _applyCollection ( resource ) . ignoreErrors ( ) ;
@@ -153,13 +157,14 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ
153
157
shell ,
154
158
) ;
155
159
const env = activatedEnv ? normCaseKeys ( activatedEnv ) : undefined ;
160
+ traceVerbose ( `Activated environment variables for ${ resource ?. fsPath } ` , env ) ;
156
161
if ( ! env ) {
157
162
const shellType = identifyShellFromShellPath ( shell ) ;
158
163
const defaultShell = defaultShells [ this . platform . osType ] ;
159
164
if ( defaultShell ?. shellType !== shellType ) {
160
165
// Commands to fetch env vars may fail in custom shells due to unknown reasons, in that case
161
166
// 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 ) ;
163
168
return ;
164
169
}
165
170
await this . trackTerminalPrompt ( shell , resource , env ) ;
@@ -352,6 +357,9 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ
352
357
// https://code.visualstudio.com/docs/terminal/shell-integration#_automatic-script-injection
353
358
return true ;
354
359
}
360
+ if ( isEnabled ) {
361
+ traceVerbose ( 'Shell integrated is disabled in user settings.' ) ;
362
+ }
355
363
return false ;
356
364
}
357
365
0 commit comments