Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Resolved: Sourcing .zshrc from .zprofile causes problems
- X-seq: zsh-users 7852
 
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
 
- To: zsh-users@xxxxxxxxxx
 
- Subject: Re: Resolved: Sourcing .zshrc from .zprofile causes problems
 
- Date: Sun, 15 Aug 2004 11:38:05 -0700 (PDT)
 
- In-reply-to: <20040815045845.GA16836@xxxxxxxxx>
 
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
 
- References: <7E0A2482-ECC4-11D8-A541-000A95D2C79E@xxxxxxxxxxxxxxxx> <Pine.LNX.4.61.0408122151280.15905@xxxxxxxxxxxxxxxxxx> <F692BDE6-EE06-11D8-BE5C-000A95D2C79E@xxxxxxxxxxxxxxxx> <20040814182036.GS7509@xxxxxxxxxxxxx> <20040815045845.GA16836@xxxxxxxxx>
 
- Reply-to: zsh-users@xxxxxxxxxx
 
On Sat, 14 Aug 2004, Wayne Davison wrote:
> The only thing I have in my .zshenv script is this:
> 
> if [[ $SHLVL == 1 && ! -o LOGIN ]]; then
>     source ~/.zprofile
> fi
> 
> I used to set things like the PATH in the .zshenv file until it caused
> me problems using gdb:  gdb runs the executable using $SHELL, and that
> caused some of my debug environment settings to get overridden (ouch).
I still set PATH in $ZDOTDIR/.zshenv (which I source from ~/.zshenv in
case ZDOTDIR isn't yet set) but I adopted this convention:
	if [[ -z $ZSH_ENVPATH ]]
	then
	  # ... various adjustments to $path including typeset -U) ...
	  export ZSH_ENVPATH=$PATH
	fi
This has the advantage of letting me check later whether something else 
has changed the path, and even force it back to its original state with 
PATH=$ZSH_ENVPATH.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author