Fix is_wsl() on wsl2#7027
Conversation
on wsl2 the /proc/version contains no Microsoft as wsl1 do.
|
|
If we treat wsl2 as linux, "webbrowser.open(fileurl)" is called. But a url like "file:///home/xxx/" doesn't work under wsl2. |
WSL2 is not officially out yet as far as I know. And even if it was, people will still be on WSL1 for a while. At least I will, since updates are controlled by company IT and they're slow at rolling out new versions of windows |
|
The "broken" versions referred to in the |
|
Okay, so if a check for lowercase "microsoft" works here as well, should we just change that everywhere? Mind that the checks are typically case-sensitive. |
|
The utsname.release on wsl1looks like "4.4.0-18362-Microsoft" (windows 1903 (18362)). |
|
@faho I have checked the files common.cpp and help.fish. They don't need to change. |
|
Yes, sounds good; the |
On wsl2, /proc/version contains no "Microsoft" as wsl1 do.
Changing "Microsoft" to "microsoft" will make it work on both wsl1 and wsl2.