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

Add path parsing logic to replace "/mount/path/to/rootfs" with "/" #95

Open
FlorianOtel opened this issue Nov 20, 2019 · 1 comment
Open

Comments

@FlorianOtel
Copy link

Setup:

I'm running VScode with WSL, but with WSL in a non-standard mount path -- WSL installed on a D:\ drive. In particular, my WSL is installed under D:\Ubuntu-1804-LTS\Ubuntu.

I have WSL installed as a terminal in VScode and git working fine inside WSL -- ssh keys and all.

wslgit is installed and working as D:\wslgit.exe

Problem:

When trying to perform git operations, wslgit.exe tries to use the whole mount path, as follows:

Looking for git in: D:\wslgit.exe
Using git 2.17.1 from D:\wslgit.exe
> git rev-parse --show-toplevel
bash: cd: /mnt/d/Ubuntu-1804-LTS/Ubuntu/rootfs/home/fotel/_AWS/GitHub/hackmd-notes: Permission denied
> git rev-parse --show-toplevel
bash: cd: /mnt/d/Ubuntu-1804-LTS/Ubuntu/rootfs/home/fotel/_AWS/GitHub/hackmd-notes/aws: Permission denied
> git rev-parse --show-toplevel
> git rev-parse --show-toplevel
> git init
bash: cd: /mnt/d/Ubuntu-1804-LTS/Ubuntu/rootfs/home/fotel/_AWS/GitHub/hackmd-notes: Permission denied

The permission denied issue is b/c it's not possible to traverse "rootfs" from inside WSL.

Proposed solution:

Please adjust the path parsing logic such that, if it contains rootfs, all previous path -- up and inculding rootfs -- are simply replaced with /. In my case have /mnt/d/Ubuntu-1804-LTS/Ubuntu/rootfs/ simply replaced with /

If this is a known problem and a solution already exists, please advise.

LMK if you need any additional info.

Thanks,

/Florian

@andy-5
Copy link
Owner

andy-5 commented Nov 21, 2019

You may try an alpha build of the upcoming version 0.9.0 available here.
In this version, all paths are handled by wslpath, and the working directory is not explicitly changed. Maybe this fixes your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants