[Pkg-zsh-devel] Bug#776663: zsh-common: Wish for /etc/zsh/zprofile.d or equivalent

Franklin Yu franklinyu at hotmail.com
Mon Aug 2 06:32:46 BST 2021


Hi Tim,

About your original request: I don’t think “/etc/zsh/zprofile.d” is going to
help. There is some distinction between x-profile and x-rc: profile are supposed
to be read only for the login shell, once (in every session). We put environment
variable there, for all the child processes to inherit. In contrast, x-rc files
should be read for all interactive invocation of shells; if I’m in an
interactive Zsh session, and I type “zsh”, this child shell reads the zshrc
again.

Whether we want to modify the path in zprofile or zshrc, depends on where you
want the change to take place. Generally I would update $PATH in
“/etc/profile.d/”, so that GUI applications like IDEs can find them (think of
PyCharm finding your Python); however, from your description, the users of your
package seem to expect the CLI tools to only be available in their interactive
shells (like Bash and Zsh). If that’s the case, then I think what you want is
actually “/etc/zsh/zshrc.d”. For example, I’m using GNOME Shell, and my terminal
emulators might are not creating “login shells” (because the actual login shell
is GNOME Shell in this case), so these Zsh sessions don’t read my “~/.zprofile”
at all.

Regards,
Franklin


More information about the Pkg-zsh-devel mailing list