diff --git a/src/client/interpreter/activation/service.ts b/src/client/interpreter/activation/service.ts index 6b49444b3b3d..80dbf6574128 100644 --- a/src/client/interpreter/activation/service.ts +++ b/src/client/interpreter/activation/service.ts @@ -180,6 +180,8 @@ export class EnvironmentActivationService implements IEnvironmentActivationServi @cache(-1, true) public async getProcessEnvironmentVariables(resource: Resource, shell?: string): Promise { + // Shell mightve been not gitbash.. Hence messed up path.. lol + // Try to get the process environment variables using Python by printing variables, that can be little different // from `process.env` and is preferred when calculating diff. const globalInterpreters = this.interpreterService diff --git a/src/client/terminals/envCollectionActivation/service.ts b/src/client/terminals/envCollectionActivation/service.ts index 3a73797de324..7047cfca31c1 100644 --- a/src/client/terminals/envCollectionActivation/service.ts +++ b/src/client/terminals/envCollectionActivation/service.ts @@ -243,6 +243,7 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ envVarCollection.prepend(key, value, defaultPrependOptions); return; } + // Avoid setting PWD. if (key === 'PATH') { // perhaps PATH is getting messed up const options = { @@ -482,6 +483,7 @@ function shouldSkip(env: string) { 'PYTHONUTF8', // We have deactivate service which takes care of setting it. '_OLD_VIRTUAL_PATH', + 'PWD', ].includes(env); }