Skip to content

Fix winhome path #212

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Victor333Huesca
Copy link

No description provided.

@crramirez
Copy link
Contributor

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
Copy link
Author

Victor333Huesca commented Mar 3, 2024

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...

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

Successfully merging this pull request may close these issues.

2 participants