From 5b103261f4169e6e1d0d3633163a8e2031234dcf Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 26 Mar 2025 07:55:16 -0400 Subject: [PATCH] feat: add wsl detection Can now be detected with (featurep :system 'wsl). --- lisp/doom.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lisp/doom.el b/lisp/doom.el index fdf9f6834..6786a9278 100644 --- a/lisp/doom.el +++ b/lisp/doom.el @@ -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)