Skip to content

Debugging leaves terminal in conda's Base environment instead of selected (interpreter's) conda environment #896

Open

Description

@zljubisic

Steps to Reproduce:

  1. I am debugging my (pytest) test using Testing > select test > Debug Test GUI.
  2. Test is executing
  3. After test finishes it leaves terminal in Base conda environment instead of selected (interpreter's) environment.

As I end up in base environment, sometimes I execute poetry install which installs current project's dependencies in base environment. Sometimes I run pytest in base environment but it is not installed there and so on.

After interpreter is selected, whatever we do, we should do it inside that selected environment.
Any terminal windows that are opening during any process should use selected environment.
We should never end up in terminal in Base conda's environment.

VS Code Version:
Version: 1.99.3 (user setup)
Commit: microsoft/vscode@17baf84
Date: 2025-04-15T23:18:46.076Z
Electron: 34.3.2
ElectronBuildId: 11161073
Chromium: 132.0.6834.210
Node.js: 20.18.3
V8: 13.2.152.41-electron.0
OS: Windows_NT x64 10.0.19045, connected to remote Ubuntu

Activity

  1. karthiknadig commented on Apr 30, 2025

    @karthiknadig
    Member

    zljubisic Can you try with the https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-python-envs extension? You may need to set python.condaPath to conda with it. That is temporary.

    That is a experimental extension that will eventually replace environment management and handling, it should do a bit better than this extension.

  2. zljubisic commented on Apr 30, 2025

    @zljubisic
    Author

    Currently, I can't afford using experimental extension at work.
    Until this problem is solved I have to execute exit in terminal whenever I want to do something in project's environment.
    Really annoying.

  3. zljubisic commented on May 6, 2025

    @zljubisic
    Author

    I believe that we can conclude here that whatever we do within our project should be done in selected environment.

  4. mumiao2000 commented on May 11, 2025

    @mumiao2000

    @zljubisic Can you try with the https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-python-envs extension? You may need to set python.condaPath to conda with it. That is temporary.

    That is a experimental extension that will eventually replace environment management and handling, it should do a bit better than this extension.

    No help with experimental or historical extension. It seems due to VSCode 1.100.0 version.

    Everything goes well except the terminal.

  5. zljubisic commented on Oct 8, 2025

    @zljubisic
    Author

    Karthik Nadig (@karthiknadig) Any progress with this issue?

  6. eleanorjboyd commented on Dec 12, 2025

    @eleanorjboyd
    Contributor

    Hi there! 👋

    Thanks again for reporting this issue. Based on what you described, this appears to touch the same parts of our environment/activation logic that we’ve recently replaced in our new Python Environments extension. A lot of the behavior in this area now follows a completely different activation and environment-resolution path, so this may already be fixed.

    We’d really appreciate it if you could try the new extension and let us know—this helps us confirm that the new implementation addresses older issues like yours.

    👉 Enable the new extension with "python.useEnvironmentsExtension": true (then you should see a Python icon in the sidebar.
    📫 More details on enablement here
    📝 Useful background documentation on activation here

    If you do run into issues, please include as much info and reproduction steps or the "Report issue..." command inside VS Code!

    Thanks again for reporting this originally, and for helping us validate the new environment direction for Python in VS Code 🙌

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

Metadata

Metadata

Labels

feature-requestRequest for new features or functionalitytriage-neededNeeds assignment to the proper sub-team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions