Skip to content
Prev Previous commit
Next Next commit
Clear env collection if activate terminal setting is turned off
  • Loading branch information
Kartik Raj
Kartik Raj committed Aug 3, 2023
commit 7ceee81f8647a3b5992d81a2b56cd240ca3791a6
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ
public async _applyCollection(resource: Resource, shell = this.applicationEnvironment.shell): Promise<void> {
const workspaceFolder = this.getWorkspaceFolder(resource);
const settings = this.configurationService.getSettings(resource);
const envVarCollection = this.getEnvironmentVariableCollection(workspaceFolder);
if (!settings.terminal.activateEnvironment) {
traceVerbose('Activating environments in terminal is disabled for', resource?.fsPath);
envVarCollection.clear();
return;
}
const env = await this.environmentActivationService.getActivatedEnvironmentVariables(
Expand All @@ -117,7 +119,6 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ
undefined,
shell,
);
const envVarCollection = this.getEnvironmentVariableCollection(workspaceFolder);
if (!env) {
const shellType = identifyShellFromShellPath(shell);
const defaultShell = defaultShells[this.platform.osType];
Expand Down