mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-31 03:51:14 -03:00
check for both wsl1 and wsl2
This commit is contained in:
@@ -47,7 +47,8 @@ def is_wsl():
|
||||
""" Return whether we are running under the Windows Subsystem for Linux """
|
||||
if "linux" in platform.system().lower() and os.access("/proc/version", os.R_OK):
|
||||
with open("/proc/version", "r") as f:
|
||||
if "microsoft" in f.read():
|
||||
# Find 'Microsoft' for wsl1 and 'microsoft' for wsl2
|
||||
if "microsoft" in f.read().lower():
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user