Skip to content

Commit 43e5f6d

Browse files
author
Kartik Raj
committed
Correctly apply PS1
1 parent 2092cea commit 43e5f6d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/client/interpreter/activation/terminalEnvVarCollectionService.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,16 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ
147147
const prevValue = previousEnv[key];
148148
if (prevValue !== value) {
149149
if (value !== undefined) {
150-
traceVerbose(`Setting environment variable ${key} in collection to ${value}`);
151-
envVarCollection.replace(key, value, { applyAtShellIntegration: true });
150+
if (key === 'PS1') {
151+
traceVerbose(`Prepending environment variable ${key} in collection with ${value}`);
152+
envVarCollection.prepend(key, value, {
153+
applyAtShellIntegration: true,
154+
applyAtProcessCreation: false,
155+
});
156+
} else {
157+
traceVerbose(`Setting environment variable ${key} in collection to ${value}`);
158+
envVarCollection.replace(key, value, { applyAtShellIntegration: true });
159+
}
152160
} else {
153161
traceVerbose(`Clearing environment variable ${key} from collection`);
154162
envVarCollection.delete(key);

0 commit comments

Comments
 (0)