Skip to content

Commit

Permalink
Do not activate microvenv if terminal.activateEnvironment is set to f…
Browse files Browse the repository at this point in the history
…alse and when not in terminal experiment (#22909)
  • Loading branch information
Kartik Raj authored Feb 13, 2024
1 parent 2dc158e commit 6838ccf
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/client/terminals/envCollectionActivation/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,16 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ

private async handleMicroVenv(resource: Resource) {
try {
const settings = this.configurationService.getSettings(resource);
const workspaceFolder = this.getWorkspaceFolder(resource);
if (!settings.terminal.activateEnvironment) {
this.getEnvironmentVariableCollection({ workspaceFolder }).clear();
traceVerbose(
'Do not activate microvenv as activating environments in terminal is disabled for',
resource?.fsPath,
);
return;
}
const interpreter = await this.interpreterService.getActiveInterpreter(resource);
if (interpreter?.envType === EnvironmentType.Venv) {
const activatePath = path.join(path.dirname(interpreter.path), 'activate');
Expand Down

0 comments on commit 6838ccf

Please sign in to comment.