Skip to content

Improvements to pythonTerminalEnvVarActivation experiment #21751

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Aug 4, 2023
Prev Previous commit
Next Next commit
Correctly apply PS1
  • Loading branch information
Kartik Raj committed Aug 3, 2023
commit 43e5f6d0ece2605c665fe6763c26a96798a93bf2
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,16 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ
const prevValue = previousEnv[key];
if (prevValue !== value) {
if (value !== undefined) {
traceVerbose(`Setting environment variable ${key} in collection to ${value}`);
envVarCollection.replace(key, value, { applyAtShellIntegration: true });
if (key === 'PS1') {
traceVerbose(`Prepending environment variable ${key} in collection with ${value}`);
envVarCollection.prepend(key, value, {
applyAtShellIntegration: true,
applyAtProcessCreation: false,
});
} else {
traceVerbose(`Setting environment variable ${key} in collection to ${value}`);
envVarCollection.replace(key, value, { applyAtShellIntegration: true });
}
} else {
traceVerbose(`Clearing environment variable ${key} from collection`);
envVarCollection.delete(key);
Expand Down