According to the docs
.zshenv
is sourced on all invocations of the shell, unless the -f option is set. It should contain commands to set the command search path, plus other important environment variables..zshenv
should not contain commands that produce output or assume the shell is attached to a tty.
Okay, cool, so I would assume that logging in via ssh is considered an invocation of zsh... but maybe not?
wayne@arglefraster ~
⚘ echo $PATH 10:01:17
/usr/local/heroku/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
wayne@arglefraster ~
⚘ zsh 10:01:20
e%
wayne@arglefraster ~
⚘ echo $PATH 10:01:24
/usr/local/heroku/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/wayne/.rvm/bin:/home/wayne/.bin:/home/wayne/.local/bin
Those extra bits of path are added in my .zshenv
file.
Is this normal, or do I have something wonky going on? Should I move my PATH modifications elsewhere?
zsh
as your default shell in/etc/passd
or you start it somehow different?wayne:x:1000:100::/home/wayne:/bin/zsh
zsh -o SOURCE_TRACE
to confirm what files are being read, and thenzsh -x
to see what configuration is done, in particular forPATH
, in the event something else is trampling the.zshenv
changes.