Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,13 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ
traceVerbose('Activating environments in terminal is disabled for', resource?.fsPath);
return;
}
const env = await this.environmentActivationService.getActivatedEnvironmentVariables(
const activatedEnv = await this.environmentActivationService.getActivatedEnvironmentVariables(
resource,
undefined,
undefined,
shell,
);
const env = activatedEnv ? normCaseKeys(activatedEnv) : undefined;
if (!env) {
const shellType = identifyShellFromShellPath(shell);
const defaultShell = defaultShells[this.platform.osType];
Expand All @@ -158,7 +159,7 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ
shell,
);
}
const processEnv = this.processEnvVars;
const processEnv = normCaseKeys(this.processEnvVars);

// PS1 in some cases is a shell variable (not an env variable) so "env" might not contain it, calculate it in that case.
env.PS1 = await this.getPS1(shell, resource, env);
Expand Down Expand Up @@ -376,3 +377,11 @@ function getPromptForEnv(interpreter: PythonEnvironment | undefined) {
}
return undefined;
}

function normCaseKeys(env: EnvironmentVariables): EnvironmentVariables {
const result: EnvironmentVariables = {};
Object.keys(env).forEach((key) => {
result[key.toUpperCase()] = env[key];
});
return result;
}