Skip to content

Commit

Permalink
Fix WSL detection for WSL2
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaBeloglazov committed Feb 17, 2024
1 parent 6e494a1 commit 1d245f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/clipman/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def detect_os():
# Detect Android by yourself because platform.system() detects Android as Linux
return "Android"

if os_name == "Linux" and os.uname().version.lower().find("microsoft") != -1:
if os_name == "Linux" and (os.uname().release.lower().find("microsoft") != -1 or os.uname().version.lower().find("microsoft") != -1):
# Detect WSL by yourself, looking at uname, because platform.system() detects WSL as Linux
return "WSL"

Expand Down

0 comments on commit 1d245f5

Please sign in to comment.