Skip to content

Integrated terminal does not auto source venv on start #98252

@ianzur

Description

@ianzur
  • VSCode Version: 1.45.1
  • OS Version: Debian 10 buster

This occurs the next time you open vscode if you leave the integrated terminal window open when exiting vscode.

Steps to Reproduce:

  1. create a new python project
mkdir vscode_bug_project
cd vscode_bug_project/
touch foo.py
  1. create a python virtual environment python3 -m venv env
  2. Set pythonPath variable for vscode
    • mkdir .vscode
    • nano .vscode/settings.json (set pythonPath as shown below)
{
        "python.pythonPath": "env/bin/python",
}
  1. code .
    • open integrated terminal ctrl+` (code correctly sources venv here!)
  2. Close vscode with integrated terminal open
  3. 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

Metadata

Metadata

Assignees

Labels

terminalGeneral terminal issues that don't fall under another label

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions