-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WSL home directory behaviour unexpected #7197
Comments
Okay this is a spitball, but what happens if you add |
My default profile does not have a
If I add:
For comparison:
So to me it looks like Windows.Terminal.Wsl is listening to "startingDirectory", but I don't know how to point it at a Ubuntu side path. So it mostly seems that the wsl.exe command has some extra logic to deal with When I googled this problem earlier the advice was to just put |
I was able to set the startingDirectory to my Ubuntu home following comments in the discussion here #592
|
I get the same result as @jstorrs, namely that it opens bash pointing at Windows/System32. I am willing to concede that the default WSL Terminal profile behaves exactly the same way as just running With WSL2, the strong recommendation is to stay within the Linux filing system because it is faster than the Windows filing system. The simplest way to achieve that is to specify "~" as the starting directory but using There does need to be a cleaner way in Terminal of telling WSL where to start. While specifying a |
That works!Thank u😉 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I'm going to stick this on the 2.0 milestone to make sure we figure out a solution to this with the WSL team. I'm not sure why this is happening, but hopefully they'll be able to give us some insight. |
Seems like Windows.Terminal.Wsl is overwriting something? |
This comment has been minimized.
This comment has been minimized.
I've been using the app execution aliases for my WSL distros in my WSL configs, and it works great. {
"guid": "{31b0ca0b-67d0-479d-901d-31b29cf05a42}",
"name": "Ubuntu",
"source": "Windows.Terminal.Wsl",
"commandline": "Ubuntu.exe"
},
{
"guid": "{f752f8d9-f2aa-4761-9eff-bc857a48e281}",
"name": "kali-linux",
"source": "Windows.Terminal.Wsl",
"commandline": "Kali.exe"
} |
For anyone wanting to reference numbered Ubuntu builds, the names are like This is a great tip, @ocitrev - thanks. |
This might be fixed, or at least mitigated by #9223 |
Using that 'cd ~' in your shell's initialisation script is a bad idea. If you do so then if you open up vscode, then open an integrated terminal, it will also open in the home directory instead of the desired default behaviour of opening the workspace root directory. I tried to change this by configuring vscode (setting (for WSL remote): terminal.integrated.cwd to ${workspaceFolder}) but this does not work. At last, I found something that works, in the windows terminals settings, set the starting directory to:
eg:
As directory names in linux are case sensitive, make sure the username is cased properly, or else it won't work. |
This just reoccurred for me. I was using I had to change the command line to Thanks to jstorrs for the hint. |
This work for me. Thanks to @jstorrs for the hint. |
The coming 1.12 release (and 1.13, if you are using Preview) is going to make this much more ergonomic. For profiles that launch |
Environment
Steps to reproduce
Expected behavior
I would expect the terminal to start in the home directory of the user.
Actual behavior
The terminal starts at "/mnt/c/Users/phili", which is the Windows home directory.
Other notes
If you add a duplicate terminal profile, change the guid and comment out the source, it works as expected.
In other words, the first profile above is the default one provided by Terminal. The second profile is my "hacked" one. The first one dumps me in my Windows home directory. The second one puts me in my Linux home directory.
In #6022, it was suggested that the behaviour changed depending on what had already happened, e.g. opening order or if WSL was already running. I took a video to show that this didn't seem to be the case for me.
The text was updated successfully, but these errors were encountered: