Skip to content

Commit

Permalink
Fix venv activation for cshell (#22852)
Browse files Browse the repository at this point in the history
Closes #22822

Use current shell to figure out whether shell integration is working,
even when using fallback shell for getting environment variables.
  • Loading branch information
Kartik Raj authored and anthonykim1 committed Feb 6, 2024
1 parent 5c1a185 commit f85c3a0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/client/terminals/envCollectionActivation/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ

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

// Clear any previously set env vars from collection
envVarCollection.clear();
Expand Down Expand Up @@ -345,8 +345,8 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ
}
}

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

0 comments on commit f85c3a0

Please sign in to comment.