Skip to content

Selected virtual environment does not automatically activate in new PowerShell terminal #2008

Open

Description

@obxkarma

Environment data

Python Environments extension: 1.42.0. Python extension: 2026.10.0. VS Code: 1.145.3 (x64). OS: Windows (version not recorded). Python: 3.12.10, uv-created virtual environment. Configured default manager: ms-python.python:system. Shell: PowerShell. Remote scenario and regression status: unknown.

Steps observed

Open a workspace containing .venv_clean (a separate .venv also exists). Select .venv_clean\Scripts\python.exe as the workspace interpreter. The workspace has python.terminal.activateEnvironment set to true and python.defaultInterpreterPath pointing to the same executable. Close all integrated terminals and open a new PowerShell terminal.

Expected behavior

The selected virtual environment is activated in the new terminal.

Actual behavior

The prompt did not show (.venv_clean). The command Python Envs: Activate Environment in Current Terminal was also tried; no visible prompt change was reported. The effective terminal environment was not captured before manual activation, so whether activation was skipped or merely not reflected in the prompt is unconfirmed.

Additional context

Manually running . .\.venv_clean\Scripts\Activate.ps1 in the same PowerShell terminal changed the prompt to (.venv_clean). PowerShell execution policy for the current user was RemoteSigned. Interpreter selection was confirmed through VS Code's environment service. The root cause is unknown, and a minimal reproduction in a fresh workspace has not yet been verified. Trace logs were not captured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions