WhitewaterFoundry / Fedora-Remix-for-WSL

Fedora Remix for Windows Subsystem for Linux.
Other
693 stars 51 forks source link

Fix winhome path #212

Open Victor333Huesca opened 7 months ago

crramirez commented 4 months ago

This PR escaped from my sight until today.

Thank you for your contribution.

Could you give an example of when the cmd.exe fails?

Victor333Huesca commented 4 months ago

Hi, To be honest, I'm a bit unsure about the actual cause of the issue this solves. Basically, after upgrading to latest fedora, I faced the following issue. wslpath: : No such file or directory I managed to pinpoint it to wHomeWinPath being empty, and thus resulting in bad wslpath invocation. After further investigation and testing, I found out that invoking cmd.exe outside system32 might (but not always, haven't found why) causes it to have no env variable defined at all (echo $(cmd.exe /c 'set') resulting in empty string).

Future me here: when trying to reproduce the issue, it seems that a cd to any directory (including .) does fix the cmd having no env vars defined. I have no idea why... Anyway, the patch can be simplified to a single cd . before the cmd invocation...