You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This occurs the next time you open vscode if you leave the integrated terminal window open when exiting vscode.
Steps to Reproduce:
create a new python project
mkdir vscode_bug_project
cd vscode_bug_project/
touch foo.py
create a python virtual environment python3 -m venv env
Set pythonPath variable for vscode
mkdir .vscode
nano .vscode/settings.json (set pythonPath as shown below)
{
"python.pythonPath": "env/bin/python",
}
code .
open integrated terminal ctrl+` (code correctly sources venv here!)
Close vscode with integrated terminal open
code .
integrated terminal is open but has not activated my virtual env
While the work around is easy enough (ctrl+d to close then ctrl+` to reopen integrated terminal which then automatically activates the venv). It is rather frustrating as my first error is a python2->3 syntax problem when starting development everyday, since I forget to close then reopen the integrated terminal or manually activate my venv.
Is there a variable that I can set to automatically kill the integrated terminal on exit?
Does this issue occur when all extensions are disabled?: Yes
The text was updated successfully, but these errors were encountered:
The terminal is killed on exit? I suspect step 6 is launching a brand new VS Code which sources a new environment based on env so it's by design that the virtual env isn't covered. For better venv support you'd be better off installing the Python extension which will automatically run it for you when you open terminals.
I don't know if the terminal is killed on exit. If I could set workbench.action.terminal.kill to be run when I close VS Code then I would consider this issue closed.
The Python extension is installed. The extension does correctly source the virtual environment when I open terminals, but sometimes the terminal is already open when I start VS Code and this open terminal has not sourced the virtual environment defined in the workspace settings.
The work around is easy enough (ctrl+d to close then ctrl+` to reopen integrated terminal which then automatically activates the venv), but currently I do not consider this issue closed.
but sometimes the terminal is already open when I start VS Code and this open terminal has not sourced the virtual environment defined in the workspace settings.
Ah it wasn't clear what you meant exactly. So this is kind of a feature of VS Code where we don't block the UI (or terminals) on the slow launching extension. There is a way to improve this that works even before the Python extension is loaded via a new API (stable in 1.46), but it's yet to be picked up by them. You should 👍 microsoft/vscode-python#11039 to add your vote as it will solve your problem.
This occurs the next time you open vscode if you leave the integrated terminal window open when exiting vscode.
Steps to Reproduce:
python3 -m venv env
mkdir .vscode
nano .vscode/settings.json
(set pythonPath as shown below)code .
ctrl+`
(code correctly sources venv here!)code .
While the work around is easy enough (
ctrl+d
to close thenctrl+`
to reopen integrated terminal which then automatically activates the venv). It is rather frustrating as my first error is a python2->3 syntax problem when starting development everyday, since I forget to close then reopen the integrated terminal or manually activate my venv.Is there a variable that I can set to automatically kill the integrated terminal on exit?
Does this issue occur when all extensions are disabled?: Yes
The text was updated successfully, but these errors were encountered: