3
votes

I have ubuntu installed on my windows 10 machine and have been using vscode. I'd like to use the wsl integrated terminal. If I just open vscode and then a new wsl terminal it shows my path as: username@Computer:/mnt/c/Users/winusername

If I then open a project folder (not workspace), and then a new terminal it shows as: username@Computer:~

This isn't in my project folder location- is there a way to get the wsl integrated terminal to set the project location as the current working directory?

Git bash does this just fine if I use it as my terminal, like this:

winusername@Computer MINGW64 /d/my/project/path

But I'd like to use wsl.

2
Where is your project folder; in wsl or in Windows? Where is vscode installed in wsl or in Windows? Did you add any tasks.json or settings.json? Which project C/C++?Biswapriyo
@Biswapriyo project folder is in windows, as is the vscode installation. Didn't add any tasks.json or settings.json. Project type is python and simple editing (markup, AWS CFN templates, docker files, etc.)Nicros
I think its duplicate version and briefly explained here stackoverflow.com/questions/43305050/…Saurav

2 Answers

0
votes

I think your configuration is little screwed.

Check the terminal configuration about User settings and workspace settings.

You can find in an easy way on UI.

  1. File > Preference > Settings

  2. Check the default 'integrated terminal' path, and cwd value.

    in my case using wsl.exe for default terminal, not bash.exe

enter image description here enter image description here

  1. compare with User settings and Workspace settings on the upside on UI about same options keys.(You can compare in easy just tapping the title)

  2. if nothing trouble on your settings, i recommend this VSCODE extension. It helps open terminal with path with opened file. https://marketplace.visualstudio.com/items?itemName=Tyriar.vscode-terminal-here&ssr=false

0
votes

I edited my settings.json like this and it did work:

"terminal.integrated.shell.windows": "${fullPathToExecutable}",
"terminal.integrated.shellArgs.windows": ["run"],
"terminal.integrated.cwd": "C:\\Users\\winusername"