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

Re: Resolved: Sourcing .zshrc from .zprofile causes problems



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