Skip to content
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

WSL drive C mounting point incorrectly detected from commented lines in wsl.conf #246

Closed
haroonrafi opened this issue May 5, 2021 · 0 comments · Fixed by #247
Closed

Comments

@haroonrafi
Copy link
Contributor

haroonrafi commented May 5, 2021

I was having an issue with incorrect detection of the drive C mount point in WSL2 as mentioned in issue #218, despite this having been fixed in PR #219. It was detecting it according to my old configuration even though I'd changed it back to /mnt/c by commenting out the lines in wsl.conf. After removing the commented lines it worked as expected.

Looking at this commit in the PR, the problem seems to be the regex which isn't excluding lines that start with #. The problem does not occur if I add a negative lookbehind:

const configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);

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 a pull request may close this issue.

1 participant