Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Gentoo startup bug

On 26/10/12 10:42, Peter Stephenson wrote:
Without going into the details, there are perfectly good reasons for
putting your path in .zshenv, such as having the same path in all
instances of the shell.
Probably. The problem I see is that it might also lead to unexpected behavior, for example if you run a script using
PATH=/some/path:$PATH zsh -f somescript

If zprofile resets the path, then moving it to zshenv will reset it in any case. So it might be an improvement if a user really wants to set PATH in .zshenv, but in other cases, it might make things worse. I'm not sure about the correct solution. Maybe setting PATH in .zshenv, but only if it has not been set?

The main point is there's really no good argument for a distribution to trash
a user's path.  You simply can't guess how the many users of many different
types are going to use the shell. I agree this bit is definitely
wrong. It's a very
different argument from, say, a specific site where you expect users to
conform to a certain way of doing things.
My point was, that simply moving zprofile to zshenv is a bad idea, since zshenv should be kept very minimalistic and zprofile might do more stuff than just setting PATH. So even if PATH should be set in zshenv, then maybe the file should be split up instead. In addition, the problem isn't really "where" PATH is reset, but that it is reset. I just wanted to point out that the simplest solution might not be the best solution.

Messages sorted by: Reverse Date, Date, Thread, Author