From 1d9a32b23150ec712ca538fc9e92b6c0da042826 Mon Sep 17 00:00:00 2001 From: Anthony Kim Date: Mon, 14 Jul 2025 11:14:15 -0700 Subject: [PATCH 1/3] Return early in activate from env var collection --- src/client/terminals/envCollectionActivation/service.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/client/terminals/envCollectionActivation/service.ts b/src/client/terminals/envCollectionActivation/service.ts index bd2ce1c6f717..09e0fefd30ab 100644 --- a/src/client/terminals/envCollectionActivation/service.ts +++ b/src/client/terminals/envCollectionActivation/service.ts @@ -45,6 +45,7 @@ import { import { ProgressService } from '../../common/application/progressService'; import { useEnvExtension } from '../../envExt/api.internal'; import { registerPythonStartup } from '../pythonStartup'; +import { trace } from 'console'; @injectable() export class TerminalEnvVarCollectionService implements IExtensionActivationService, ITerminalEnvVarCollectionService { @@ -97,6 +98,14 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ public async activate(resource: Resource): Promise { try { + if (useEnvExtension()) { + traceVerbose('Return early of activate since env extension is being used'); + this.context.environmentVariableCollection.clear(); + // Needed for shell integration + await registerPythonStartup(this.context); + return; + } + if (!inTerminalEnvVarExperiment(this.experimentService)) { this.context.environmentVariableCollection.clear(); await this.handleMicroVenv(resource); From 312e4cad2cd8cd540149315d69d0dd4b1a4ebcdf Mon Sep 17 00:00:00 2001 From: Anthony Kim Date: Mon, 14 Jul 2025 11:16:56 -0700 Subject: [PATCH 2/3] lint --- src/client/terminals/envCollectionActivation/service.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/client/terminals/envCollectionActivation/service.ts b/src/client/terminals/envCollectionActivation/service.ts index 09e0fefd30ab..ef9dd767614f 100644 --- a/src/client/terminals/envCollectionActivation/service.ts +++ b/src/client/terminals/envCollectionActivation/service.ts @@ -45,7 +45,6 @@ import { import { ProgressService } from '../../common/application/progressService'; import { useEnvExtension } from '../../envExt/api.internal'; import { registerPythonStartup } from '../pythonStartup'; -import { trace } from 'console'; @injectable() export class TerminalEnvVarCollectionService implements IExtensionActivationService, ITerminalEnvVarCollectionService { From 6fe70c21b26137f27e5f9285db93434b4b0b7b5a Mon Sep 17 00:00:00 2001 From: Anthony Kim <62267334+anthonykim1@users.noreply.github.com> Date: Mon, 14 Jul 2025 11:40:17 -0700 Subject: [PATCH 3/3] Update src/client/terminals/envCollectionActivation/service.ts Co-authored-by: Eleanor Boyd <26030610+eleanorjboyd@users.noreply.github.com> --- src/client/terminals/envCollectionActivation/service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/terminals/envCollectionActivation/service.ts b/src/client/terminals/envCollectionActivation/service.ts index ef9dd767614f..2ce8d5d5d86a 100644 --- a/src/client/terminals/envCollectionActivation/service.ts +++ b/src/client/terminals/envCollectionActivation/service.ts @@ -98,7 +98,7 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ public async activate(resource: Resource): Promise { try { if (useEnvExtension()) { - traceVerbose('Return early of activate since env extension is being used'); + traceVerbose('Ignoring environment variable experiment since env extension is being used'); this.context.environmentVariableCollection.clear(); // Needed for shell integration await registerPythonStartup(this.context);