aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2019-10-01 00:49:54 +0300
committerDylan Araps <dylan.araps@gmail.com>2019-10-01 00:49:54 +0300
commit46b68022a3964cfb5a77d91cc2b129612547aaf2 (patch)
treeb3babdb97951023c6d644bddd96fb88031713ec4
parent146c6b6baee1371afa32c772aa60862e84df9ebb (diff)
downloadpfetch-46b68022a3964cfb5a77d91cc2b129612547aaf2.tar.gz
pfetch: Simpler WSL2 detection.
-rwxr-xr-xpfetch9
1 files changed, 4 insertions, 5 deletions
diff --git a/pfetch b/pfetch
index 825855b..f2694f4 100755
--- a/pfetch
+++ b/pfetch
@@ -189,11 +189,10 @@ get_os() {
# WSL2 (Windows subsystem for Linux [version 2]) and
# append a string accordingly.
#
- # If either of these environment variables are defined
- # and non-empty, we are very likely running under
- # Windows 10 in WSL2.
- [ "$WSL_INTEROP" ] || [ "$WSLENV" ] || [ "$WSL_DISTRO_NAME" ] &&
- distro="$distro on Windows 10 [WSL1]"
+ # This checks to see if '$WSLENV' is defined. This
+ # appends the Windows 10 string even if '$WSLENV' is
+ # empty. We only need to check that is has been _exported_.
+ distro="${distro}${WSLENV+ on Windows 10 [WSL2]}"
;;
Darwin*)