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

Re: --enable-etcdir for multiple locations (similar to PATH)



On Thu, Jun 23, 2016 at 3:14 AM, Ben Woods <woodsb02@xxxxxxxxx> wrote:
>
> I am wondering if it is possible to tell zsh to look in multiple different
> locations for it's startup/shutdown configuration files?

No, it's not.  We discussed this issue several (more like many) years
ago and concluded that the number of different ways that zsh can find
configuration files is already complicated enough, maybe even too
complicated.

> This is important, because in FreeBSD, configuration files for ports are
> not supposed to be in /etc, but in /usr/local/etc. However, we are aware
> that many people with read the official zsh documentation at the link below
> and try to put the configuration files in /etc.

The correct solution to this is for the port itself to supply the
/usr/local/etc file containing something like e.g for
/usr/local/etc/zshrc

[[ -f /etc/zshrc && ! /etc/zshrc -ef /usr/local/etc/zshrc ]] && source
/etc/zshrc

Additional tests to prevent recursive "source"ing are possible but may
be overkill.



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