laurent22 / wslpath

wslpath - Converts Unix and Windows format paths in WSL
MIT License
107 stars 8 forks source link

need to double backslash to use from wsl #1

Closed pcause closed 6 years ago

pcause commented 7 years ago

if i do an echo $(wslpath foo) the name looks like:

c:\x\foo

but if from the wsl/linux environment i pass this to a windows program as an argument the windows program as follows:

somexex.exe $(wslpath foo)

the windows exe sees

c:xfoo

since the shell will trest a \x as x when parsing to pass to the executable. you need to double the backslashes to get the right path format to use with Windows apps from wsl

laurent22 commented 7 years ago

Hmm, that's strange, I'm not seeing this behaviour. For example, if I go to /mnt/c/Windows and do wslpath WindowsUpdate.log I get this:

$ wslpath WindowsUpdate.log
C:\Windows\WindowsUpdate.log

Then if I do notepad.exe $(wslpath WindowsUpdate.log) it opens the file as expected. Is it doing this with a particular path?

laurent22 commented 6 years ago

Cannot replicate

BrunoVernay commented 11 months ago

Might be an issue with ZSH. See these threads: https://stackoverflow.com/questions/64079604/what-are-the-differences-in-echo-between-zsh-and-bash
Use setopt BSD_echo