Skip to content

Commit 8aaa70e

Browse files
author
Kartik Raj
authored
Fix venv activation for cshell (#22852)
Closes #22822 Use current shell to figure out whether shell integration is working, even when using fallback shell for getting environment variables.
1 parent 1626c46 commit 8aaa70e

File tree

1 file changed

+3
-3
lines changed
  • src/client/terminals/envCollectionActivation

1 file changed

+3
-3
lines changed

src/client/terminals/envCollectionActivation/service.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ
188188

189189
// PS1 in some cases is a shell variable (not an env variable) so "env" might not contain it, calculate it in that case.
190190
env.PS1 = await this.getPS1(shell, resource, env);
191-
const prependOptions = await this.getPrependOptions(shell);
191+
const prependOptions = await this.getPrependOptions();
192192

193193
// Clear any previously set env vars from collection
194194
envVarCollection.clear();
@@ -345,8 +345,8 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ
345345
}
346346
}
347347

348-
private async getPrependOptions(shell: string): Promise<EnvironmentVariableMutatorOptions> {
349-
const isActive = await this.shellIntegrationService.isWorking(shell);
348+
private async getPrependOptions(): Promise<EnvironmentVariableMutatorOptions> {
349+
const isActive = await this.shellIntegrationService.isWorking(this.applicationEnvironment.shell);
350350
// Ideally we would want to prepend exactly once, either at shell integration or process creation.
351351
// TODO: Stop prepending altogether once https://github.com/microsoft/vscode/issues/145234 is available.
352352
return isActive

0 commit comments

Comments
 (0)