-
Notifications
You must be signed in to change notification settings - Fork 28.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrated terminal does not auto source venv on start #98252
Comments
The terminal is killed on exit? I suspect step 6 is launching a brand new VS Code which sources a new environment based on |
I don't know if the terminal is killed on exit. If I could set 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. |
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: