zsh-users
 help / color / mirror / code / Atom feed
From: Doug Morris <doug@olsen.ch>
To: monnier@tequila.cs.yale.edu, zsh-users@sunsite.auc.dk
Subject: Re: zsh startup files
Date: Thu, 25 Mar 1999 12:17:31 +0100	[thread overview]
Message-ID: <9903251117.AA09841@rouble.olsen.ch> (raw)
In-Reply-To: Your message of "Thu, 25 Mar 1999 00:53:32 EST." <19990325005332.B5194@astaroth.nit.gwu.edu>

I can vaguely see a reason for this. The files are sourced
differently depending on the type of the shell being started. ie:

Always sourced
/etc/zshenv ~/.zshenv

Sourced for non-interactive login shells
/etc/zshenv ~/.zshenv /etc/zprofile ~/.zprofile /etc/zlogin ~/.zlogin

Sourced for interactive login shells
/etc/zshenv ~/.zshenv /etc/zprofile ~/.zprofile /etc/zshrc ~/.zshrc
/etc/zlogin ~/.zlogin

So it almost makes sense. You don't want the ~/.z* files waiting for
all the /etc/z* files to be sourced first. Still, this doesn't seem
like it would be too difficult to correct. The thing to do, though,
would be to change the order to:

Non-interactive Login shell
/etc/zshenv /etc/zprofile /etc/zlogin ~/.zprofile ~/.zshenv ~/.zlogin

Interactive Login Shell
/etc/zshenv /etc/zprofile /etc/zshrc /etc/zlogin ~/.zshenv ~/.zprofile
~/.zshrc ~/.zlogin 

I believe the diff below of init.c from zsh-3.0.5 will produce this
behavior. It appears to apply to zsh-3.1.5 as well, though I haven't
tried building it to make sure.


Since writing the above, I've received the list message from Peter
Stephenson <pws@ibmth.df.unipi.it> saying there may be a good reason
for leaving things alone. I guess this diff may or may not be useful.

However, I'd argue that, if you're going to make it a switchable
option. It should use this order by default, and the switch should
enable the old source order.  Maintaining backward compatibility is a
worthy plan, but I think correcting this odd order is better in the
long run and should be the default. The option should be provided to
allow people who need time to migrate their environment a temporary
workaround.


-Doug Morris 
"You don't have to deceive programmers to make them think that hours
 of painstaking, often frustrating work is fun... they do it to
 themselves."
 Noel Giffin, The Stone Soup Story


*** init.c.orig	Thu Mar 25 09:35:12 1999
--- init.c	Thu Mar 25 10:03:47 1999
***************
*** 744,770 ****
  	source(GLOBAL_ZSHENV);
  #endif
  	if (isset(RCS)) {
- 	    if (unset(PRIVILEGED))
- 		sourcehome(".zshenv");
- 	    if (islogin) {
  #ifdef GLOBAL_ZPROFILE
  		source(GLOBAL_ZPROFILE);
  #endif
- 		if (unset(PRIVILEGED))
- 		    sourcehome(".zprofile");
- 	    }
- 	    if (interact) {
  #ifdef GLOBAL_ZSHRC
  		source(GLOBAL_ZSHRC);
  #endif
- 		if (unset(PRIVILEGED))
- 		    sourcehome(".zshrc");
- 	    }
- 	    if (islogin) {
  #ifdef GLOBAL_ZLOGIN
  		source(GLOBAL_ZLOGIN);
  #endif
! 		if (unset(PRIVILEGED))
  		    sourcehome(".zlogin");
  	    }
  	}
--- 744,768 ----
  	source(GLOBAL_ZSHENV);
  #endif
  	if (isset(RCS)) {
  #ifdef GLOBAL_ZPROFILE
+ 	    if (islogin) 
  		source(GLOBAL_ZPROFILE);
  #endif
  #ifdef GLOBAL_ZSHRC
+ 	    if (interact) 
  		source(GLOBAL_ZSHRC);
  #endif
  #ifdef GLOBAL_ZLOGIN
+ 	    if (islogin) 
  		source(GLOBAL_ZLOGIN);
  #endif
! 	    if (unset(PRIVILEGED)) {
! 		sourcehome(".zshenv");
! 		if (islogin) 
! 		    sourcehome(".zprofile");
! 		if (interact)
! 		    sourcehome(".zshrc");
! 		if (islogin)
  		    sourcehome(".zlogin");
  	    }
  	}


  reply	other threads:[~1999-03-25 11:19 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-24 22:48 Stefan Monnier
1999-03-24 23:15 ` Sweth Chandramouli
1999-03-25  0:47   ` Stefan Monnier
1999-03-25  5:53     ` Sweth Chandramouli
1999-03-25 11:17       ` Doug Morris [this message]
1999-03-25  2:20   ` Jason Price
1999-03-25  9:03 ` Peter Stephenson
     [not found]   ` <9903251002.AA18225@ibmth.df.unipi.it>
1999-03-25 10:55     ` Wolfgang Hukriede
1999-03-25 11:22       ` Peter Stephenson
1999-03-25 12:36         ` Stefan Monnier
1999-03-25 14:00           ` Peter Stephenson
1999-03-25 19:37             ` Stefan Monnier
1999-03-28  1:04               ` Bart Schaefer
1999-03-28 22:14                 ` Stefan Monnier
1999-03-29  1:57                   ` Bart Schaefer
1999-03-29  4:14                     ` Sweth Chandramouli
1999-03-29 14:15                     ` Stefan Monnier
1999-03-29 14:29                       ` Andrej Borsenkow
1999-03-31  7:14                         ` Bart Schaefer
1999-03-31  7:49                           ` Bart Schaefer
1999-04-02 13:12                           ` Stefan Monnier
1999-04-02 17:13                             ` Bart Schaefer
  -- strict thread matches above, loose matches on Subject: below --
2006-03-14 17:38 zzapper
2006-03-14 19:50 ` Wayne Davison
2006-03-15  2:43   ` Bart Schaefer
2006-03-15 18:22     ` Phil Pennock
2006-03-16 19:29     ` Dominic Mitchell
1996-10-19 23:04 Zsh " Nate Johnston
1996-10-20 11:09 ` Zefram

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9903251117.AA09841@rouble.olsen.ch \
    --to=doug@olsen.ch \
    --cc=monnier@tequila.cs.yale.edu \
    --cc=zsh-users@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).