how to change vs code terminal directory path to curent workspace folder
IDE
Hey i need help with VS code terminal ...
so suppose i opened a "project" folder in vscode
and powershell terminal inside vscode showing directory path like this: PS D:\work\project>
and now inside "project" in vs code as task required, If i create some more nested Folders and file suppose(hello\hello.py) and now vs code powershell terminal showing path like this: PS D:\work\project\hello>
but i want terminal directory path to start from "project" , something like PS project\hello>
how to achieve this ?
So basically in vs code if i open a folder terminal should start its directory path from that folder
Is their any solution to that..



Sort by:
Best
Open comment sort options
Best
Top
New
Controversial
Old
Q&A
"I'm new to coding however; I fixed this on my end by following this tutorial https://www.youtube.com/watch?v=M2_v8eTQul4
Also I had to create a project save in the designated folder in order for the video to work for me.
Not sure if you still need this or not.
In VS code go to File>Preferences>Settings
Type in cwd or Terminal Integrated
Set your desired start path in the integrated terminal section
Click on Terminal and create new terminal
Hope this helps!
With the added note that the value should be ${workspaceFolder}
Open Settings: Click on the gear icon in the lower-left corner and select "Settings" or press
Ctrl + ,
.Open Settings (JSON): Click on the icon in the top-right corner of the settings pane to open the settings in JSON format.
Configure Terminal CWD: Add the following setting to ensure the terminal opens in the directory of the currently active file:jsonCopy code{ "terminal.integrated.cwd": "${fileDirname}" }
Its works for me !
You can set up profiles and alias' in bash shells. A quick search turned up this stackoverflow post. Bear in mind when I did cs50 they had a custom cs50 online IDE not vscode. Is the current IDE browser based or desktop based?
Edit: honestly I'm not sure if I'm even answering the right question your post is hard to read.
Sorry for typo's, I'll try to explain it again: So if in local desktop version of vscode when i open any project folder, than terminal in vscode (powershell) show directory path info like from D:/work/project (I'm using "D" drive here).
So, how to change vscode terminal settings so it uses "project" workspace folder as a start of directory path of terminal
I agree with u/MarlDaeSu, your post is not the easiest to read :)
If you ask how to navigate in the terminal, there is a shorts or section video in one of the first weeks that explains some of the basic commands to use in the terminal.
Sorry for confusion, I tried again buy updating the post..
So my question is not about navigating through the directory..
In vs code suppose we choose "project_1" as folder
Than inside which I create "hello" folder than "hello.py"
So in terminal directory path should look like this
"PS D:\work\project_1\hello> python hello.py"
since I'm working in "Project_1" folder, instead of starting from root (D:\work\...........so on..)
how to make it start from "project_1\hello>"
thank u for this i was trying to change to a diff directory from an existing one so i tried cd my_folder but it wasnt working so i had to mention the absolute path and for some reason still didnt work and then i used this to go back home and then to the directory.