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

init files



	okay, i've been playing around with the init files that
zsh uses, trying to figure out which ones get invoked when, and i 
think i've got it all mostly worked out; the flowchart i've made 
is attached to this message.  i still have some questions, though.
there was a thread about this maybe a year ago, wherein bart (i 
think) had said that the NO_RCS option was checked before the
sourcing of /etc/zshrc and $ZDOTDIR/.zshrc; no matter what i've
tried, however, i've been unable to to reproduce this (which my
chart reflects).  also, i'm not perfectly clear on what tests
are done to determine whether or not a shell is a login shell
and/or an interactive one.  i've got those tests that i've been
able to confirm empirically listed in the footnotes on my chart,
but i'm sure that there are others.  at the very least, the man
pages state that INTERACTIVE can be set to a different value,
whereas whenever i try to do so, i get an error back; similarly,
the tests given in the STARTUP FILES section of the manpage
for a login shell (-l or -zsh) aren't true for any of my login
shells, but they are still recognized as such.  so which are
the tests that i'm missing?

	-- sweth.

-- 
Sweth Chandramouli
IS Coordinator, The George Washington University
<sweth@xxxxxxx> / (202) 994 - 8521 (V) / (202) 994 - 0458 (F)
<a href="http://astaroth.nit.gwu.edu/~sweth/disc.html";>*</a>
ZSH initialization file load sequence:

                        |
                  {/etc/zshenv}
                        |
                        |
                        | (is NO_RCS set?[1])
                        |
                        |
           [yes]        |     [no]
      ----------------------------------
      |                                |
      |                                |
      |                        {$ZDOTDIR/.zshenv}
      |                                |
      |                                | (is this a login shell?[2])
      |                                |
      |                         [yes]  |  [no]
      |                 -------------------------------
      |                 |                             |
      |          {/etc/zprofile}                      |
      |                 |                             | (is this shell
      |        {$ZDOTDIR/.zprofile}                   | interactive?[3])
      |                 |                             |
      |                 |                      [yes]  |  [no]
      |                 |                    -------------------
      |                 |                    |                 |
      |           {/etc/zshrc}         {/etc/zshrc}            |
      |                 |                    |                 | 
      |         {$ZDOTDIR/.zshrc}    {$ZDOTDIR/.zshrc}         |
      |                 |                    |                 |
      |                 |                    |                 |
      |           {/etc/zlogin}              |                 |         
      |                 |                    |                 |        
      |         {$ZDOTDIR/.zlogin}           |                 |
      |                 |                    |                 |
      |                 |                    |                 |
   **************************************************************** 
   *                             SHELL                            *
   **************************************************************** 
      |                 |                    |                 |
      |                 | (is NO_RCS         |                 |
      |                 | set?[1])           |                 |
      |                 |                    |                 |
      |          [yes]  |  [no]              |                 |
      |        -------------------           |                 |  
      |        |                 |           |                 |
      |        |         {$ZDOTDIR/.zlogout} |                 |
      |        |                 |           |                 |
      |        |           {/etc/zlogout}    |                 |
      |        |                 |           |                 |
      x        x                 x           x                 x

Tests are matched as follows, in increasing order of precedence;
`unsetopt OPTION' is equivalent to `setopt NO_OPTION' and `unsetopt
NO_OPTION' is equivalent to `setopt OPTION' in terms of precedence. 
For example, zsh -f with `unsetopt NO_RCS' in /etc/zshenv will source
/etc/zshenv, $ZDOTDIR/.zshenv, /etc/zshrc, and $ZDOTDIR/.zshrc.

[1]   DEFAULT                                   => [no]
      `setopt NO_RCS' called before test        => [yes]
      `-f' flag present on shell invocation     => [yes]
      `setopt RCS' called before test           => [no]
      
[2]   DEFAULT                                   => [no]
      first character of argument zero (name 
         by which zsh is invoked) is `-'        => [yes]
      `-l' flag present on shell invocation     => [yes]
      
[3]   DEFAULT                                   => [no] 
      `-i' flag present on shell invocation     => [yes]
      standard input is a tty and commands 
         are being read from standard input     => [yes]
         


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