Skip to content

Unexpected Launch of Terminal During Switch of Python Interpreter #25215

Open
@SanBingYouYong

Description

@SanBingYouYong

Behaviour

Upon switching a python interpreter in F1 panel and Python: switch interpreter, the status bar shows "reactivating terminal" and then pops up the default terminal specified by Terminal › External: Windows Exe (in my case cmd), which quickly exits. Then the environment is successfully switched.

Steps to reproduce:

  1. Set up multiple Python environment (e.g. using conda)
  2. (Optional) open a python project, so can confirm Python extension is running and providing highlights.
  3. Switch Python interpreter as described in Behavior section.
  4. Observe that terminal windows pops up and disappear during"reactivating terminal" status.
  5. Confirm that Python interpreter is switched.

Diagnostic data

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

(also, why are we printing ENV VARs to this especially when the recommended way to handle API keys are to add them to .env files... please do ensure this kind of data is anonymized and cleaned before uploading in any terms)

2025-06-25 16:47:08.964 [info] Active interpreter [c:\ZSY\imperial\courses\IndividualProject\ip-scenecraft]:  C:\Users\13152\miniconda3\envs\icip\python.exe
2025-06-25 16:47:08.965 [info] Discover tests for workspace name: ip-scenecraft - uri: c:\ZSY\imperial\courses\IndividualProject\ip-scenecraft
2025-06-25 16:47:08.966 [info] Python interpreter path: ~\miniconda3\envs\icip\python.exe
2025-06-25 16:47:08.978 [info] > ~/miniconda3/Scripts/activate ; conda activate icip ; echo 'e8b39361-0157-4923-80e1-22d70d46dee6' ; python ~/.vscode/extensions/ms-python.python-2025.8.0-win32-x64/python_files/printEnvVariables.py
2025-06-25 16:47:08.979 [info] shell: powershell
2025-06-25 16:47:12.638 [info] Setting environment variable ***_API_KEY in collection to *** {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2025-06-25 16:47:12.638 [info] Setting environment variable CONDA_DEFAULT_ENV in collection to icip {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2025-06-25 16:47:12.638 [info] Setting environment variable CONDA_PREFIX in collection to C:\Users\13152\miniconda3\envs\icip {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2025-06-25 16:47:12.638 [info] Setting environment variable CONDA_PREFIX_1 in collection to C:\Users\13152\miniconda3 {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2025-06-25 16:47:12.638 [info] Setting environment variable CONDA_PROMPT_MODIFIER in collection to (icip)  {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2025-06-25 16:47:12.638 [info] Setting environment variable CONDA_SHLVL in collection to 2 {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2025-06-25 16:47:12.638 [info] Setting environment variable ***_API_KEY in collection to *** {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2025-06-25 16:47:12.638 [info] Setting environment variable ***_API_KEY in collection to *** {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2025-06-25 16:47:12.638 [info] Setting environment variable ***_API_KEY in collection to ***  {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2025-06-25 16:47:12.638 [info] Setting environment variable ***_API_KEY in collection to *** {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2025-06-25 16:47:12.638 [info] Prepending environment variable PATH in collection to C:\Users\13152\miniconda3\envs\icip;C:\Users\*** {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2025-06-25 16:47:12.638 [info] Setting environment variable PYTHONIOENCODING in collection to utf-8 {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2025-06-25 16:47:12.638 [info] Setting environment variable PYTHONUNBUFFERED in collection to 1 {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2025-06-25 16:47:12.638 [info] Setting environment variable SSL_CERT_FILE in collection to C:\Users\13152\miniconda3\envs\icip\Library\ssl\cacert.pem {"applyAtShellIntegration":true,"applyAtProcessCreation":true}

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage-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