Creating new Integrated Terminal doesn't take selected workspace into account when activating environment
See original GitHub issueEnvironment data
- Version: 1.54.0-insider (user setup)
- Commit: e590188f17162393f50feec19263398e6fe02d13
- Date: 2021-02-26T20:39:10.253Z
- Electron: 11.3.0
- Chrome: 87.0.4280.141
- Node.js: 12.18.3
- V8: 8.7.220.31-electron.0
- OS: Windows_NT x64 10.0.19042
- Python version (& distribution if applicable, e.g. Anaconda): python3.8
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): Pipenv and just venv
– Relevant/affected Python packages and their versions: XXX
– Relevant/affected Python-related VS Code extensions and their versions: XXX
– Value of the
python.languageServer
setting: XXX
Expected behaviour
This is while working with multiple projects in a workspace.
Up until recently, just a day or two ago, Selecting a “New Integrated Terminal” worked perfectly. It asks “Select current working directory for new terminal”. The terminal would perfectly pick up the correct venv based on the folder’s settings namely python.pythonPath.
Actual behaviour
Now, it seems to pick the venv based on the last file or editor only. If I click a workspaceX file, it uses the venv for workspaceX no matter what “Select current working directory for new terminal” directory is chosen in the prompt. 😦
Steps to reproduce:
Here is a minimal example.
- Create new project folder test1.
- Create new project folder test2.
- cd test1; mkdir venv; python -m venv venv; touch test1.py; cd …
- cd test2; mkdir venv; python -m venv venv; touch test2.py; cd …
- Save project settings.
mkdir test1/.vscode
cat > test1/.vscode/settings.json
{
"python.pythonPath": "venv/bin/python"
}
mkdir test2/.vscode
cat > test2/.vscode/settings.json
{
"python.pythonPath": "venv/bin/python"
}
- Save workspace
cat > workspace.code-workspace
{
"folders": [
{
"path": "test1"
},
{
"path": "test2"
}
],
"settings": {}
}
- Now open the workspace. Select test2.py. New Integrated Terminal -> Select test1 -> you get: source /home/jchang/proj/tests/bugreport/test2/venv/bin/activate
This should be using test1 not test2!!! This used to work up until the last day or two! 😦
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:13
Top Results From Across the Web
Visual Studio Code terminal doesn't activate Conda environment
First, open the Anaconda prompt (How to access Anaconda command prompt in Windows 10 (64-bit)), and type: conda activate tom. To activate your...
Read more >Troubleshoot Terminal launch failures - Visual Studio Code
Troubleshooting steps · Check your user settings. Review these terminal. · Test your shell directly. Try running your designated integrated terminal shell outside ......
Read more >Efficient Way to Activate Conda in VSCode - Medium
We simply use the one in the specific conda environment. ... Choose “Terminal: Create New Integrated Terminal (In Active Workspace); In the Terminal...
Read more >VS Code tips — Terminal profiles - YouTube
Today's VS Code tip: terminal profilesLaunch a specific shell in the integrated terminalVS Code auto creates profiles for common shells such ...
Read more >Manage Python environments and interpreters - Visual Studio ...
For any given project, you can select a specific environment rather than use the default. For details on creating and using virtual environments...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the logs, I’ll try to reproduce and get back to you soon.
Fixed with https://github.com/microsoft/vscode-python/pull/17595