Repository navigation
Add support for WSL shell in Windows - #7821
Conversation
The shell is invoked with `wsl.exe`, which uses whichever Linux distribution the user has configured as their default. [1] The option is presented to the user when the following conditions are met: 1. `wsl.exe` and `wslconfig.exe` are both found in the system. 2. `wslconfig.exe /list` returns an exit code of zero. I verified that `wslconfig.exe /list` returns a non-zero exit code when the system has no Linux distributions installed. I decided to avoid the registry for detection since that has been discouraged by the WSL developers. [2] Closes #4641 [1]: https://docs.microsoft.com/en-us/windows/wsl/wsl-config#wsl-and-wsl-command [2]: microsoft/WSL#3515
I think this is better rather than just returning NULL we can get a log of what happened.
|
I created this PR as the original author said he could no longer champion it so I wanted to help out and work on it (sorry if there's a better way to do this 😳). As per the original PR I added the exit code to the error message, along with an extra log when the wslPath returns null just for some extra visibility as to what happened. I also added a reject call when the process is spawned, but I need to test it and make sure the error is actually handled as the documentation mentions that it's possible to have some weird behavior. |
shiftkey
left a comment
There was a problem hiding this comment.
Just one change to improve our error handling, everything else tests great on the latest WSL2 builds in Windows 10.
|
I also managed to get up and running with WSL finally and tested it on the current WSL and everything seems to check out in Windows 10. |
|
Thanks for helping to get this across the line @ADustyOldMuffin! And thanks @jayschwa for laying the groundwork! |
|
This is still feature-flagged for development, so I'm going to merge this in so we can do more testing and then figure out when we want to enable it for beta to gather more feedback. |
Overview
Closes #4641
Description
Written by @jayschwa on #6420