-
Notifications
You must be signed in to change notification settings - Fork 828
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
wslpath -u C: returns C: rather than /mnt/c #7111
Comments
Effectively #4908. Different under the premise drives are special paths. |
@therealkenc Disagree, I don't see this as a feature request for missing paths, but as a defect correction for existing paths. C: and C:\ cannot be not equivalent except for the trailing slash or backslash. |
Hi @deliverystack this is currently expected behaviour. Currently as wslpath is implemented the string Is there a scenario that you're blocked with from this behaviour? Or anything that it's breaking for you? In the meantime I'll close this issue out as 'by design' for our tracking but am happy to follow up on this thread, and am tracking #4908 to improve wslpath for scenarios like this. Thanks! |
Thanks, I am not blocked, I can just add the trailing backslash on C:\ in my code or workaround it otherwise, but it is unpredicted and inconsistent behavior that may affect other projects. I think at the very least it might appear as a note in help for the command, or if passed -u [A-Za-z]:[^\\/], as from my perspective, C: exists and is equivalent to C:, the only difference is the slash token. |
Got it! That sounds very reasonable to me, I'll keep it tracked in 4908 as part of general improvements there. Thanks for the feedback :) |
This is an issue when using
Yes, you could append the slash to the variable, but I don't think that is a reasonable solution because we don't know what odd values It would be reasonable to expect this to work |
Windows Build Number
21390.2025
WSL Version
Kernel Version
5.10.16
Distro Version
Ubuntu 20.24
Other Software
No response
Repro Steps
$ file
which wslpath
/usr/bin/wslpath: symbolic link to /init
$ wslpath -u "C:\"
/mnt/c/
$ wslpath -u "C:"
C:
Expected Behavior
wslpath -u "C:" returns /mnt/c
Actual Behavior
wslpath -u "C:" returns "C:"
Diagnostic Logs
No response
The text was updated successfully, but these errors were encountered: