Home > Back-end >  How to change the starting directory in Visual Studio code?
How to change the starting directory in Visual Studio code?

Time:03-14

When I try to run any program, it says "terminal process failed, starting directory does not exist" (bottom right in the image). So I changed the terminal>integrated cwd to a different path, it still says path the old path does not exist. How do I change the starting directly? Everyone and everything says it is terminal>integrated cwd, but it is not working.enter image description here

I have tried searching for the old directory in VScode, but I can't find it.

CodePudding user response:

If you don't want a default path for your terminal just set this cwd option as empty. That way your terminal will open in the "root path" being the "root" the place you are right now, if you open a folder at C:\Users\yourname\yourfolder your terminal will be opened there, if you open your folder at C:\Users\yourname\yourotherfolder\foo\bar your terminal will be opened at ...\foo\bar.

If you're editing the configs from the settings.json and not from the UI option, change the "terminal.integrated.cwd" option to "".

Maybe you where trying to change that config to set a default interpreter path? Like instead of open cmd or powershell by defaul open the Git Bash one? If so, you can change it at Terminal > Integrated > Default Profile: Windows. To do it on settings.json will be "terminal.integrated.defaultProfile.windows": "Git Bash" or whatever that you want, "powershell" to powershell, etc.

CodePudding user response:

It's the User setting, could you open the Workspace setting? It's just next to the User setting.

  • Related