From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2989 invoked from network); 14 Mar 2006 19:50:46 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 14 Mar 2006 19:50:46 -0000 Received: (qmail 84487 invoked from network); 14 Mar 2006 19:50:32 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 14 Mar 2006 19:50:32 -0000 Received: (qmail 13771 invoked by alias); 14 Mar 2006 19:50:26 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10021 Received: (qmail 13762 invoked from network); 14 Mar 2006 19:50:25 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 14 Mar 2006 19:50:25 -0000 Received: (qmail 83479 invoked from network); 14 Mar 2006 19:50:25 -0000 Received: from dsl3-63-249-88-2.cruzio.com (HELO dot.blorf.net) (63.249.88.2) by a.mx.sunsite.dk with SMTP; 14 Mar 2006 19:50:25 -0000 Received: by dot.blorf.net (Postfix, from userid 1000) id 16C8C860; Tue, 14 Mar 2006 11:50:23 -0800 (PST) Date: Tue, 14 Mar 2006 11:50:23 -0800 From: Wayne Davison To: zzapper Cc: zsh-users@sunsite.dk Subject: Re: zsh startup files Message-ID: <20060314195023.GE9875@dot.blorf.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.11+cvs20060126 On Tue, Mar 14, 2006 at 05:38:37PM +0000, zzapper wrote: > I've got everything in my ~/.zshenv can I do better? Doing this means that you can't override anything that is set in the .zshenv file and have it affect another zsh script or indeed any command that was spawned using $SHELL (which affects a lot of commands that run other commands, such as gdb). Because of this, I moved all my non- interactive variable settings into ~/.zprofile (my interactive settings have always been in ~/.zshrc) and I reduced the ~/.zshenv file to these 3 lines: if [[ $SHLVL == 1 && ! -o LOGIN ]]; then source ~/.zprofile fi The overall idea is that I want these variables to be set once, and then inherited from then on. The reason for the above 3 lines is that some X windows environments don't start a login shell for an xterm, so this code makes sure that a top-level shell that is not a login shell still includes the zprofile information that would have been included automatically by a login shell. If you have other settings that you always want to be forced into a certain state regardless of the parent environment, you could set them there as well. ..wayne..