ZSH not sourcing zprofile

~/.zprofile is only sourced when zsh is run as login shell, e.g. when logging in on the console or via SSH.

It will not be sourced by zsh when opening a new terminal or starting a new zsh session from within a running session. Anything you need in all interactive sessions, should be set in ~/.zshrc. Anything you need in all zsh sessions, including scripts, should be set in ~/.zshenv.

You can find additional information in the zshall manpage and on this site.

~/.zshprofile will (usually) also not be parsed by any other tools. So any environment variables set in ~/.zprofile will usually not be available in an X11 session. If you need some environment variable to be available globally in your session, you might want to have a look at man pam_env.

Leave a Comment