Skip to content

Prevent double/triple activation from two extensions#25849

Merged
eleanorjboyd merged 3 commits intomainfrom
anthonykim1/fixDoubleTripleActivation
Mar 11, 2026
Merged

Prevent double/triple activation from two extensions#25849
eleanorjboyd merged 3 commits intomainfrom
anthonykim1/fixDoubleTripleActivation

Conversation

@anthonykim1
Copy link

Resolves: microsoft/vscode-python-environments#1325

Cause: The Python extension only backed off if the user explicitly opted into the envs extension (useEnvironmentsExtension: true). But the envs extension activates by default whenever it's installed — it only backs off if the setting is explicitly false. So in this case, (extension installed, setting not touched), both fired.

Added shouldEnvExtHandleActivation() — a function that mirrors the envs extension's own logic: "am I installed and not explicitly disabled?" Used it in all 3 places the Python extension triggers terminal activation to bail out when the envs extension will handle it. This covers global, workspace, and folder-level settings.

We want exactly one extension activates the terminal, never both, never neither.

@anthonykim1 anthonykim1 added this to the 1.112.0 milestone Mar 11, 2026
@anthonykim1 anthonykim1 self-assigned this Mar 11, 2026
@anthonykim1 anthonykim1 added bug Issue identified by VS Code Team member as probable bug area-terminal labels Mar 11, 2026
@anthonykim1 anthonykim1 marked this pull request as ready for review March 11, 2026 17:02
@eleanorjboyd eleanorjboyd merged commit 172d9e6 into main Mar 11, 2026
86 checks passed
@eleanorjboyd eleanorjboyd deleted the anthonykim1/fixDoubleTripleActivation branch March 11, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-terminal bug Issue identified by VS Code Team member as probable bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When opening a new terminal, Python venv is activated twice

2 participants