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

Re: zsh-newuser-install running before global "source" files



Abhishek Banerji wrote on Mon, 15 Aug 2022 19:56 +00:00:
> Hi,
> I noticed that no matter where I set ZDOTDIR env variable,
> zsh-newuser-install will always look for $HOME/.z* files and shows the new
> user message and prompt. But I can press 'q' and it will then source
> $ZDOTDIR files and everything works from there. but every new shell (via
> ssh) or terminal i open the new user prompt shows up.
>
> I have set ZDOTDIR env variable in the following files and in
> zsh-newuser-install the variable is not set.
>
> ones i had to create
> /etc/zprofile
> /etc/zshenv
> /etc/zshrc
>
> this one was already present
> /etc/zsh/zprofile
>
> DISTRO: Archlinux

zsh-newuser-install has been looking for $ZDOTDIR before $HOME
since 2005 at least.

Chances are the global zshenv file isn't called /etc/zshenv in your
build.  Check that . «strings =zsh | grep zshenv» or «strace -e file zsh
-fc : 2>&1 | grep zshenv» should find it.

Setting $ZDOTDIR in the global zprofile or zshrc isn't expected to work
as these are sourced _after_ zsh-newuser-install is run.  [Citation:
Src/init.c:run_init_scripts().]

Cheers,

Daniel
(who suspects there's an easier answer that he's overlooking)




Messages sorted by: Reverse Date, Date, Thread, Author