fix(emacs): don't import TERM from systemd
This commit is contained in:
@@ -249,19 +249,21 @@ form."
|
|||||||
|
|
||||||
(defun syd-import-systemd-environment ()
|
(defun syd-import-systemd-environment ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(with-temp-buffer
|
(let ((blacklist '("TERM")))
|
||||||
(shell-command "systemctl --user show-environment" (current-buffer))
|
(with-temp-buffer
|
||||||
(goto-char (point-min))
|
(shell-command "systemctl --user show-environment" (current-buffer))
|
||||||
(while (re-search-forward
|
(goto-char (point-min))
|
||||||
(rx bol (group (+ (not "=")))
|
(while (re-search-forward
|
||||||
"="
|
(rx bol (group (+ (not "=")))
|
||||||
(or (and "$'" (group (* (not "'"))) "'")
|
"="
|
||||||
(group (* any)))
|
(or (and "$'" (group (* (not "'"))) "'")
|
||||||
eol)
|
(group (* any)))
|
||||||
nil t)
|
eol)
|
||||||
(let ((var (match-string 1))
|
nil t)
|
||||||
(val (or (match-string 2)
|
(let ((var (match-string 1))
|
||||||
(match-string 3))))
|
(val (or (match-string 2)
|
||||||
(setenv var val)))))
|
(match-string 3))))
|
||||||
|
(unless (member var blacklist)
|
||||||
|
(setenv var val)))))))
|
||||||
|
|
||||||
(provide 'syd/prelude)
|
(provide 'syd/prelude)
|
||||||
|
|||||||
Reference in New Issue
Block a user