Score:2

How to change the default directory that WSL Ubuntu terminal (on Windows 10) opens with

in flag

I installed the WSL Bash on Windows 10 so it can act as my terminal in VScode, but the default directory is ~/home/USERNAME

I would like it to be /mnt/c/Users/USERNAME (so on my windows domain side)

I've looked at so many different angles on how to change the default from adding a command to .bashrc that manually changes the directory on startup, to going to the registry editor and trying to change the default directory for CMD, (turns out even that's a challenge as the file I needed to alter doesn't even exist but that's a problem for another day)

Any ideas on how I can change the WSL ubuntu18.04 terminal so that the default directory on startup is different?

in flag
[This may do what you need](https://askubuntu.com/a/332065/1222991)
muru avatar
us flag
Annoyingly enough, this is exactly what the Terminal app does for me if I *don't* set a starting directory (leaving me in `/mnt/c/Users/USERNAME`)
muru avatar
us flag
@ZaneK I was talking about the new [Windows Terminal app](https://github.com/microsoft/terminal) which has an option to set the starting directory for each profile.
ZaneK avatar
in flag
@muru How do you set a starting directory?
ZaneK avatar
in flag
@matigo Sorry, it seems that changing .bashrc DOES make a different for the regular Ubuntu terminal but perhaps NOT for the WSL ubuntu terminal on windows 10 which is what a require it for. (it ignores my additions to the bashrc file, I try cd .. and it does nothing)
Score:0
ng flag

All of this is done in VS Code.

First, make sure to install the Remote - WSL VS Code extension.

Open user preferences: File -> Preferences -> Settings

In "Search settings" type cwd

In the block labeled Terminal > Integrated: Cwd enter /mnt/c/Users/[your windows user name]

Close settings and reopen the terminal and the starting directory should now be your windows user directory.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.