From 5d502329a2262cdc62b8d8760324fc6072b69feb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Madeleine=20Sydney=20=C5=9Alaga?= Date: Tue, 7 Jul 2026 16:39:27 -0600 Subject: [PATCH] fix(emacs): don't import TERM from systemd --- .../users/msyds/emacs/lisp/syd/prelude.el | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/modules/home/users/msyds/emacs/lisp/syd/prelude.el b/modules/home/users/msyds/emacs/lisp/syd/prelude.el index ac832d4..22a1881 100755 --- a/modules/home/users/msyds/emacs/lisp/syd/prelude.el +++ b/modules/home/users/msyds/emacs/lisp/syd/prelude.el @@ -249,19 +249,21 @@ form." (defun syd-import-systemd-environment () (interactive) - (with-temp-buffer - (shell-command "systemctl --user show-environment" (current-buffer)) - (goto-char (point-min)) - (while (re-search-forward - (rx bol (group (+ (not "="))) - "=" - (or (and "$'" (group (* (not "'"))) "'") - (group (* any))) - eol) - nil t) - (let ((var (match-string 1)) - (val (or (match-string 2) - (match-string 3)))) - (setenv var val))))) + (let ((blacklist '("TERM"))) + (with-temp-buffer + (shell-command "systemctl --user show-environment" (current-buffer)) + (goto-char (point-min)) + (while (re-search-forward + (rx bol (group (+ (not "="))) + "=" + (or (and "$'" (group (* (not "'"))) "'") + (group (* any))) + eol) + nil t) + (let ((var (match-string 1)) + (val (or (match-string 2) + (match-string 3)))) + (unless (member var blacklist) + (setenv var val))))))) (provide 'syd/prelude)