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

Re: zsh startup files



Stefan Monnier wrote:
> Am I the only one that keeps getting annoyed by the sequence in which startup
> files are read ?

No, it's a problem.  But getting it right is not that simple.
Compatibility is a major consideration, and every time something
significant like this changes, a great number of people are extremely
irritated; furthermore, sometimes it's useful for the user to get in
pre-emptively in ~/.zshenv before the remaining system files (no, I don't
want to explain).

One possibility is that we could allow an option to be set either on the
command line or in /etc/zshenv, so that all system files are run first.
Unfortunately I don't see a way of allowing a user to make a login shell
work this way, but if it's a question of how the system files are handled
maybe it's OK to leave it to the sysadmin.

How about the option name GLOBAL_RCS_FIRST and the letter -b (for begin, we
don't have many spare letters)?  It should be an easy patch for zsh 3.1.

To summarise: Invoking zsh -b, or calling `setopt GLOBAL_RCS_FIRST' in
/etc/zshenv, would force the order of scripts to be
  /etc/zshenv /etc/zprofile /etc/zshrc /etc/zlogin
  ~/.zshenv ~/.zprofile ~/.zshrc ~/.zlogin
As with the NO_RCS option, setting or unsetting the option at any later
point would have no effect.  The sysadmin could force all the global
scripts to be used before the user does anything.

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy



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