File tree 1 file changed +11
-2
lines changed
src/client/interpreter/activation 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -133,12 +133,13 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ
133
133
traceVerbose ( 'Activating environments in terminal is disabled for' , resource ?. fsPath ) ;
134
134
return ;
135
135
}
136
- const env = await this . environmentActivationService . getActivatedEnvironmentVariables (
136
+ const activatedEnv = await this . environmentActivationService . getActivatedEnvironmentVariables (
137
137
resource ,
138
138
undefined ,
139
139
undefined ,
140
140
shell ,
141
141
) ;
142
+ const env = activatedEnv ? normCaseKeys ( activatedEnv ) : undefined ;
142
143
if ( ! env ) {
143
144
const shellType = identifyShellFromShellPath ( shell ) ;
144
145
const defaultShell = defaultShells [ this . platform . osType ] ;
@@ -158,7 +159,7 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ
158
159
shell ,
159
160
) ;
160
161
}
161
- const processEnv = this . processEnvVars ;
162
+ const processEnv = normCaseKeys ( this . processEnvVars ) ;
162
163
163
164
// PS1 in some cases is a shell variable (not an env variable) so "env" might not contain it, calculate it in that case.
164
165
env . PS1 = await this . getPS1 ( shell , resource , env ) ;
@@ -376,3 +377,11 @@ function getPromptForEnv(interpreter: PythonEnvironment | undefined) {
376
377
}
377
378
return undefined ;
378
379
}
380
+
381
+ function normCaseKeys ( env : EnvironmentVariables ) : EnvironmentVariables {
382
+ const result : EnvironmentVariables = { } ;
383
+ Object . keys ( env ) . forEach ( ( key ) => {
384
+ result [ key . toUpperCase ( ) ] = env [ key ] ;
385
+ } ) ;
386
+ return result ;
387
+ }
You can’t perform that action at this time.
0 commit comments