cli/env: fix doom-env-ignored-vars not being ignored

And add HOME to ignored vars.
This commit is contained in:
Henrik Lissner 2019-12-02 16:24:02 -05:00
parent a0d94e0db7
commit 24506f15bf
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -57,20 +57,20 @@ Why this over exec-path-from-shell?
;; Helpers
(defvar doom-env-ignored-vars
'("^PWD$"
"^PS1$"
"^R?PROMPT$"
"^DBUS_SESSION_BUS_ADDRESS$"
'("^DBUS_SESSION_BUS_ADDRESS$"
"^GPG_AGENT_INFO$"
"^GPG_TTY$"
"^TERM$"
"^HOME$"
"^PS1$"
"^PWD$"
"^R?PROMPT$"
"^SSH_AGENT_PID$"
"^SSH_AUTH_SOCK$"
;; Doom envvars
"^INSECURE$"
"^DEBUG$"
"^YES$"
"^TERM$"
;; Doom envvars
"^DEBUG$"
"^INSECURE$"
"^YES$"
"^__")
"Environment variables to not save in `doom-env-file'.
@ -122,7 +122,7 @@ default, on Linux, this is '$SHELL -ic /usr/bin/env'. Variables in
;; user's interactive shell, therefore we just dump
;; `process-environment' to a file.
(dolist (env process-environment)
(if (cl-find-if (doom-rpartial #'string-match-p env)
(if (cl-find-if (doom-rpartial #'string-match-p (car (split-string env "=")))
doom-env-ignored-vars)
(print! (info "Ignoring %s") env)
(insert env "\n")))