feat: add wsl detection

Can now be detected with (featurep :system 'wsl).
This commit is contained in:
Henrik Lissner
2025-03-26 07:55:16 -04:00
parent 8a2c7fe3d4
commit 5b103261f4

View File

@ -132,6 +132,13 @@
(defconst doom--system-macos-p (eq 'macos (car doom-system)))
(defconst doom--system-linux-p (eq 'linux (car doom-system)))
;; Announce WSL if it is detected.
(when (and doom--system-linux-p
(if (boundp 'operating-system-release) ; is deprecated since 28.x
(string-match-p "-[Mm]icrosoft" operating-system-release)
(getenv-internal "WSLENV")))
(add-to-list 'doom-system 'wsl 'append))
;; `system-type' is esoteric, so I create a pseudo feature as a stable and
;; consistent alternative, for use with `featurep'.
(push :system features)