chung
chung

Reputation: 1133

How to get terminal to default open into my virtual environment?

I've created a virtual environment for Python and VSCode, but everytime I open up the terminal, rather than opening up to the work environment folder, it opens up to the folder where I keep my .py file.

Let me explain my steps.

I've created a Work folder, then a work environment folder inside of it. C:\Work and C:\Work\work_env

Next I've created a folder in C:\Work\myprojects to place my .py files in. Now when I open up the terminal in VSCode, it runs the Activate.ps1 file and my work environment is ready to use but ONLY when I navigate into my work environment folder using cd in the terminal.

Is there a way to default it so that the terminal is open to the work environment right away? I followed all the steps in this short tutorial and this guy got his terminal to work that way but it's different for me. https://www.youtube.com/watch?v=Wuuiga0wKdQ

Thanks!

Upvotes: 1

Views: 366

Answers (1)

MrBens
MrBens

Reputation: 1260

Add the following line to your settings.json:

"terminal.integrated.cwd": "DESIRED/PATH"

You can find more details here.

Upvotes: 2

Related Questions