chiark / gitweb /
dot/zshenv: Don't read `~/.zprofile' in a login shell.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 12 Jul 2024 17:50:22 +0000 (18:50 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 12 Jul 2024 17:50:22 +0000 (18:50 +0100)
The `~/.zshenv' file gets read /before/ `~/.zprofile', so, if this is
a login shell, the profile would be read twice.  Take evasive action.

dot/zshenv

index ec3683811be5f570cf6cb4c6a9d928d52ef1e0d0..5f57b55b28e582aefad5052958ec46d43476b0dc 100644 (file)
@@ -3,5 +3,5 @@
 ### Last ditch sanity for Zsh invocations.
 
 case ${SSH_CONNECTION+t},${__mdw_profile+t} in
 ### Last ditch sanity for Zsh invocations.
 
 case ${SSH_CONNECTION+t},${__mdw_profile+t} in
-  t,) . "$HOME/.zprofile" ;;
+  t,) if [[ ! -o login ]]; then . "$HOME/.zprofile"; fi ;;
 esac
 esac