Skip to content
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 default directory forced to windows filesytem #9055

Closed
aarware opened this issue Feb 5, 2021 · 7 comments
Closed

WSL default directory forced to windows filesytem #9055

aarware opened this issue Feb 5, 2021 · 7 comments
Labels
Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting

Comments

@aarware
Copy link

aarware commented Feb 5, 2021

There seems to be no way to set the default directory to the root or any directory under the wsl file system.

No mater what I use for "startingDirectory" it always resolves to
/mnt/c/<startingDirectory>

I have tried using

  • "" converts to /mnt/c/windows/system32
  • "/" converts to /mnt/c
  • "~" converts to current windows user home directory
  • "/home/<my linux user>" converts to current windows user home directory

This is the current settings I have for the wsl terminal

{
  "guid": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}",
  "hidden": false,
  "name": "Ubuntu-20.04",
  "source": "Windows.Terminal.Wsl",
  "startingDirectory": "~",
  "tabColor":"#d35115"
   }
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Feb 5, 2021
@LuanVSO
Copy link
Contributor

LuanVSO commented Feb 5, 2021

the starting path is always a windows path. use this:

"startingDirectory": "\\\\wsl$\\<distro name>\\<wsl path>",

@aarware
Copy link
Author

aarware commented Feb 5, 2021

Thanks for the fast response.
Seems weird, if you open the linux shell directly the starting path is not windows file system but linux and functions as one would expect, so I don't understand why this would be coded to force it to windows file system, seems a bit counterintuitive.

I tired the suggestion "assuming i did it right", still does not work

I tried

  • "startingDirectory": "\\wsl$\\Ubuntu-20.04\\~"
  • "startingDirectory": "\\wsl$\\Ubuntu-20.04"
  • "startingDirectory": "\\wsl$"
  • "startingDirectory": "wsl$"

Thanks

@LuanVSO
Copy link
Contributor

LuanVSO commented Feb 5, 2021

did you escape the 2 backslashes at the start of the path in the json? it has to be \\\\ because \\ is interpreted as \

@sarim
Copy link
Contributor

sarim commented Feb 5, 2021

try this:

"startingDirectory": "\\\\wsl$\\Ubuntu-20.04\\home\\username"

put your ubuntu username in username.

@Don-Vito
Copy link
Contributor

Don-Vito commented Feb 7, 2021

@aarware

@DHowett
Copy link
Member

DHowett commented Feb 12, 2021

Thanks @Don-Vito. This looks like a rehash of 592/5377 plus a little bit of "sometimes WSL doesn't do the right thing." We're working on it, and we think the solution we're working on will make it better even in case WSL doesn't start up the network share.

@DHowett DHowett closed this as completed Feb 12, 2021
@aarware
Copy link
Author

aarware commented Feb 12, 2021

Sorry for the late response, Thanks @sarim and @LuanVSO that was it, I just did not have the "wsl path" as home\\username.

I still think its strange for the default to open the windows user root, nevertheless, Thanks to all for making this I definitely will get a lot of use of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting
Projects
None yet
Development

No branches or pull requests

5 participants