Skip to content

Automated terminal activation kills all running tasks in terminals #1375

Closed as not planned

Description

When I run uv sync on a freshly-cloned project, VS Code detects the new virtual environment, and activates it in all terminals.

However, in order to do this, it sends an interrupt signal in all terminals, causing most running tasks to exit. This is incredibly annoying in some projects, especially as the action can sometimes occur randomly up to 2 minutes after the virtual environment is created.

To reproduce

  1. git clone a Python project
  2. Start up the project, eg by running uv run [program]
  3. UV creates the virtual environment and starts the program
  4. VS Code then immediately kills the freshly-started program

Why this is incredibly disruptive to my workflow

I work as a university tutor. I am currently assignment marking, and to do so I must uv run large numbers of student projects. Every time I do this, VS Code kills their project part-way through testing.

Activity

  1. anthonykim1 commented on Mar 23, 2026

    @anthonykim1
    Contributor

    Could you try switching to shell startup? Then it wont send any activation command visible, but rather terminal would be ready from the start.

    Please set python-envs.terminal.autoActivationType to shellStartup in your settings.
    Also add "python.useEnvironmentsExtension": true, to your settings.json.

  2. added
    area-activationIssue related to activation. Root cause can be from interpreter selection or activation in terminal
    area-terminalEnvironment extension specific terminal issues.
    on Mar 23, 2026
  3. MaddyGuthridge commented on Mar 23, 2026

    @MaddyGuthridge
    Author

    Indeed that does work. Could it be a good idea to make that option be the default, as it (a) performs better and (b) is less disruptive.

  4. joneuhauser commented on Jun 22, 2026

    @joneuhauser

    Please set python-envs.terminal.autoActivationType to shellStartup in your settings.

    On an SSH session, that config seems to be disabled. Instead i set

    "python.terminal.activateEnvironment": false
    
  5. eleanorjboyd commented on Sep 23, 2026

    @eleanorjboyd
    Contributor

    🤖 Thanks for the report and for confirming the workaround. Command-based activation is intentionally the default because it can activate environments in any shell; shellStartup is the non-disruptive opt-in for supported shells, and off is available where no automatic activation is wanted. The same Ctrl+C behavior was subsequently reviewed and closed as designed in #1570. Please continue using "python-envs.terminal.autoActivationType": "shellStartup" for this workflow.

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

Metadata

Metadata

Labels

area-activationIssue related to activation. Root cause can be from interpreter selection or activation in terminalarea-terminalEnvironment extension specific terminal issues.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions