Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Sourcing .zshrc from .zprofile causes problems
- X-seq: zsh-users 7822
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Sourcing .zshrc from .zprofile causes problems
- Date: Thu, 12 Aug 2004 22:11:55 -0700 (PDT)
- In-reply-to: <7E0A2482-ECC4-11D8-A541-000A95D2C79E@xxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <7E0A2482-ECC4-11D8-A541-000A95D2C79E@xxxxxxxxxxxxxxxx>
- Reply-to: zsh-users@xxxxxxxxxx
On Thu, 12 Aug 2004, lists wrote:
> if [[ -f ~/.zshrc ]]; then . ~/.zshrc ; fi
>
> in my .zprofile
That shouldn't be necessary. The ~/.zshrc is read by all interactive
shells, and the ~/.zprofile by all login shells. Although it's possible
to create a non-interactive login shell, it's rather unlikely.
So the problem here ...
> .zshrc:unalias:181: no such hash table element: run-help
... is that the ~/.zshrc is read _twice_, once when you source it and then
again when zsh normally would read it, and the second time run-help has
already been unaliased.
> The error message goes away when in don't source .zshrc in my .zprofile.
Yep.
> However, at that point the following zstyle from my .zshrc file
>
> zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
>
> doesn't work
There must be some kind of order-dependency involved. The normal sequence
of file reads (where you fail to see colored listings) would be (ignoring
zshenv and zlogin for now)
/etc/zprofile
~/.zprofile
/etc/zshrc
~/.zshrc
To make colored listings work, you've changed the order to
/etc/zprofile
~/.zprofile + ~/.zshrc
/etc/zshrc
~/.zshrc
When you "exec zsh" chances are it's no longer a login shell, so the two
zprofile files are not sourced in that case ... since coloring works then,
that would tend to indicate that something in the ~/.zprofile is causing
the problem, and it would have to be something that comes after the point
where you inserted the sourcing of ~/.zshrc.
Does ~/.zprofile perhaps change the value of $LS_COLORS ?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author