-
Notifications
You must be signed in to change notification settings - Fork 59
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
Use wslpath for Insider Builds 17063 and later #12
Comments
That looks great. I haven't access to a Insiders Build ATM, but I will eventually evaluate this approach to replace my functions. |
If raw buffers were used instead of any coercion to UTF-8 The A major roadblock for |
Yes, I'm also worried about these issues, but |
This should no longer be limited just insider builds now that 1803 ("Spring Creators Update") has dropped. |
You would still need a version check since not everyone will upgrade nor even be offered the upgrade immediately. |
@andy-5 I'd really appreciate the To address one of @diablodale 's concerns. You can now directly invoke eg. |
While I'd also like to support Translating Windows paths in arguments to The more difficult part is identifying paths in the output of git that can be translated back to a corresponding Windows path. Currently, this is done by just looking for Maybe you can share your |
I guess it could potentially make it slower again, but you could always query for the mount point prior to searching for output paths. eg. My # Mount Windows drives to '/' instead of '/mnt/'
[automount]
root = / As I stated previously, this config allows Docker volumes to mount in the proper way when using Docker via the WSL, so I imagine that I'm not the only one with a custom mount point. See this issue for details. |
I think the command The result of C: on /c type drvfs (rw,noatime,uid=1000,gid=1000,umask=22,fmask=11,metadata)
D: on /where/mount/manually/d type drvfs (rw,noatime,uid=1000,gid=1000,umask=22,fmask=11,metadata) Then, you can match path in the output by strings: (Because WSL allow you mount other drive manually same with other Linux platform by command |
Thanks @hangxingliu, that is an interesting idea. Does anyone know if |
@andy-5 Just tried manually mounting a USB drive. Results below... # Setup
sudo mkdir /e
sudo mount -t drvfs E: /e
wslpath E:\\
# Output: wslpath: E:\: No such file or directory
wslpath -w /e
# Output: E:\ Tried a few different things, but I can't get it to convert from a Windows path to a WSL one. The other way around works fine. I've tried starting a new shell and a few different paths on my USB. No luck. I don't have a second hard drive in my laptop, but I can test that tonight on my desktop. |
Any progress on this? Using Windows 18.09 (stable release) and a mount point of
My
And
|
For anyone else landing on this issue like I did, there is now a Should be a decent workaround for most of the reasons this was requested. |
In lack of a better way why not just make an env-var in windows that if set its value is used as the mount root, for example |
@carlolars That's a good idea, this should cover the most common use cases. Although it introduces a little bit of duplication with |
I've implemented support for custom mount root using WSLGIT_MOUNT_ROOT environment variable. First I tried with detecting the mount root by finding the mount point for a windows drive from the output of |
Maybe
|
@carlolars That is an interesting idea, at least for the win->linux conversation. The output of the git command still needs to be processed separately. |
I've just released v0.9.0, which now uses |
Windows Insider builds 17063 and later include a
wslpath
tool to translate between Linux and Windows style paths. This could be used in place of the currenttranslate_path_to_unix
andtranslate_path_to_win
implementations. The options are as follows:Source: https://blogs.windows.com/windowsexperience/2017/12/19/announcing-windows-10-insider-preview-build-17063-pc/
The text was updated successfully, but these errors were encountered: