Skip to content

Commit 6838ccf

Browse files
author
Kartik Raj
authored
Do not activate microvenv if terminal.activateEnvironment is set to false and when not in terminal experiment (#22909)
1 parent 2dc158e commit 6838ccf

File tree

1 file changed

+9
-0
lines changed
  • src/client/terminals/envCollectionActivation

1 file changed

+9
-0
lines changed

src/client/terminals/envCollectionActivation/service.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,16 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ
353353

354354
private async handleMicroVenv(resource: Resource) {
355355
try {
356+
const settings = this.configurationService.getSettings(resource);
356357
const workspaceFolder = this.getWorkspaceFolder(resource);
358+
if (!settings.terminal.activateEnvironment) {
359+
this.getEnvironmentVariableCollection({ workspaceFolder }).clear();
360+
traceVerbose(
361+
'Do not activate microvenv as activating environments in terminal is disabled for',
362+
resource?.fsPath,
363+
);
364+
return;
365+
}
357366
const interpreter = await this.interpreterService.getActiveInterpreter(resource);
358367
if (interpreter?.envType === EnvironmentType.Venv) {
359368
const activatePath = path.join(path.dirname(interpreter.path), 'activate');

0 commit comments

Comments
 (0)