Skip to content

Commit

Permalink
Correctly apply PS1
Browse files Browse the repository at this point in the history
  • Loading branch information
Kartik Raj committed Aug 3, 2023
1 parent 2092cea commit 43e5f6d
Showing 1 changed file with 10 additions and 2 deletions.
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

0 comments on commit 43e5f6d

Please sign in to comment.