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

Re: zsh startup files



> } Note that this `exec' solution cannot be used for the case of commands
> } executed from `rsh'.
> I say, so what?  Only the two zshenv files are being sourced in that case
> anyway.

Good point.

> The canonical example of this being useful is terminal setup, which is
> frequently done in /etc/profile on SVR4 systems (Motorola, Data General,
> Olivetti, NCR, etc., where Bourne shell is often still the default shell)
> and which a sysadmin is therefore likely to place in /etc/zprofile.

[ passing note:  if someone could tell me in which case terminal setup
  is useful, I'd be happy to learn.  I've never needed any such thing.
  I thought it was because I only use xterm terminals, but now that I have
  a dumb-terminal plugged into my workstation, I have to revise this
  judgment.  Maybe the terminal setup is only unnecessary for xterm and
  vt220-compatible (i.e. for vt100-style) terminals ? ]

> Settings in zshrc and zlogin (whether /etc/ or ~/.) may depend on correct
> values of TERM, LINES, and COLUMNS; it's too late to fix them after the
> entire system initialization has run (without duplicating the parts that
> rely on them), but too early to fix them before /etc/zprofile.

Could you give examples of zshrc (zlogin is irrelevant to me: you either use
zlogin or zprofile, not both) settings that might depend on TERM/LINES/COLUMNS?
Also, if the sysadmin's files require changes in .zprofile for /etc/zshrc to
work properly, it just means that /etc/zprofile (or /etc/zshrc) is somewhat
bogus.  It seems more likely that /etc/zshrc works properly when executed
straight after /etc/zprofile and the .profile might break it.

> about what happens in between in /etc/z*, rather than simply wanting to
> skip it entirely and do only your own stuff, then you need to get your
> shot at it both before and after.

The /etc/z* files should be *minimal*.  Anything that is not strictly
necessary should be moved to /etc/user/foo and explicitly sourced from ~/.z*
(themselves inherited from /etc/skel/.z*).  This gives the user and the
sysadmin much more freedom and flexibility than the default complex sequence.

> I entirely agree that if what you want is for that other code to NOT run,
> then the current startup file system is deficient.  That's a different
> issue from running the code in some other order.

Actually, the ability to use NO_RCS is really all I need since I can then
manually source the files I want in the order I want.
The complex setup suggested by Sweth seems unwarranted and cumbersome.
The only problem with NO_RCS is the logout files, so adding a variable
holding the files to be executed at logout is all that's needed.


	Stefan



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