forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
area-terminalbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable buggood first issueverifiedVerification succeededVerification succeeded
Milestone
Description
Environment data
- Version: 1.54.0-insider (user setup)
- Commit: e590188
- 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 thepython.languageServersetting: 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! :(
rlabrecque
Metadata
Metadata
Assignees
Labels
area-terminalbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable buggood first issueverifiedVerification succeededVerification succeeded