Skip to content

Debugger, "Run Python File", etc. fails when launched into a new terminal #950

Closed

Description

@estyrke

When doing something that launches a command in a new terminal (e.g. pressing the debug button on a test as I was doing right now), the env activation command seems to block execution of the launch. I'm left with an interactive prompt and nothing happens:

source /Users/emil/[redacted]/.venv/bin/activate
 /usr/bin/env /Users/emil/[redacted]/.venv/bin/python /Users/emil/.vscode/extensions/ms-python.debugpy-2025.15.2025102001-darwin-arm64/bundled/libs/debugpy/adapter/../../debugpy/launcher 53878 -- /Users/emil/.vscode/extensions/ms-python.python-2025.17.2025101701-darwin-arm64/python_files/vscode_pytest/run_pytest_script.py -vv --rootdir=/Users/emil/[redacted] --capture=no 
~/C/[redacted] ❯❯❯  

I am using OS X, zsh (with prezto if that is relevant). Worth noting is also that the env doesn't get activated either, so basically the two commands seem to cancel each other in some way.

I tried changing python-envs.terminal.autoActivationType to shellStartup instead of command, but then the env doesn't get activated at all. It does however solve the issue at hand. If the command happens to launch into an existing terminal it also works fine.

Activity

  1. added
    bugIssue identified by VS Code Team member as probable bug
    area-terminalEnvironment extension specific terminal issues.
    area-activationIssue related to activation. Root cause can be from interpreter selection or activation in terminal
    and removed on Dec 12, 2025
  2. anthonykim1 commented on Dec 12, 2025

    @anthonykim1
    Contributor

    Can you try again with latest insiders and latest pre-release of Python env extension.

    Also, do you have shell integration enabled?

    Insiders build?

  3. anthonykim1 commented on Dec 12, 2025

    @anthonykim1
    Contributor
    Image

    Try not using prezto prompt, also hover over terminal tab to see shell integration is rich or something else.

  4. anthonykim1 commented on Feb 2, 2026

    @anthonykim1
    Contributor

    Emil Styrke (@estyrke) Are you still able to replicate?
    Plan is to make shell startup as default: #962

  5. estyrke commented on Feb 3, 2026

    @estyrke
    Author

    Anthony Kim (@anthonykim1) No, I am not able to replicate the original issue. If I have python-envs.terminal.autoActivationType set to shellStartup, the env seems to be activated and it works to start the debugger. Likewise, if python-envs.terminal.autoActivationType is set to command, the debugger launches, but before the environment has been activated (it still works since the full interpreter path is used). The env activation command seems to run after the debugger has exited in that case.

    Thanks for fixing this! As a side note I still have prezto enabled, but it seems like maybe the prompt is messing things up for the terminal integration. When I mouse over the terminal tab I see Prompt input: | my-git-branch-name ✭ ✱ ◼ whereas it shows only Prompt input: | if I disable the prezto prompt.

  6. Tyriar commented on Feb 3, 2026

    @Tyriar
    Contributor

    Emil Styrke (@estyrke) that means prezto isn't compatible with vscode's shell integration currently. This means some features won't work properly like terminal intellisense or other things that depend on extracting the prompt input.

  7. estyrke commented on Feb 4, 2026

    @estyrke
    Author

    Just for anyone else finding this thread: I believe this isn't a problem with prezto itself, just with the specific prompt I was using, which contains text at the right edge of the line. I switched to a different prompt which doesn't have that, and then it works fine as far as I can see.

  8. locked as resolved and limited conversation to collaborators on Apr 26, 2026
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.bugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from poster

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions