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

Re: zsh changes appended MANPATH value to prepended value



On Mon, Aug 26, 2024 at 6:42 PM Eric Cook <llua@xxxxxxx> wrote:
>
> On 8/26/24 6:37 PM, Eric Cook wrote:
> > On 8/26/24 6:31 PM, Justin Su wrote:
> >> I am using Ghostty terminal on macOS Sonoma. Ghostty appends itself to MANPATH on startup, so zsh inherits MANPATH as:
> >>
> >> :/Applications/Ghostty.app/Contents/Resources/ghostty/../man
> >>
> >> After zsh inits, MANPATH is:
> >>
> >> /usr/share/man:/usr/local/share/man:/Applications/Ghostty.app/Contents/Resources/ghostty/../man:
> >>
> >> That is, zsh changes MANPATH so that Ghostty is prepended, instead of appended.
> >>
> >> This happens with no zsh user configuration. Please help me understand why this is happening, as I do not think this is correct behaviour.
> >>
> >> Please cc me on all replies. Thanks in advance.
> >
> > % grep -ri MANPATH Src
> > Src/init.c:    manpath  = mkarray(NULL);
> > Src/params.c:     **manpath,            /* $manpath     */
> > Src/params.c:IPDEF8("MANPATH", &manpath, "manpath", PM_TIED),
> > Src/params.c:IPDEF9("manpath", &manpath, "MANPATH", PM_TIED),
> >
> > outside of making $manpath tied to $MANPATH, zsh doesn't do anything with MANPATH.
> > So it is indeed configuration related, possibly done by your os vendor.
> >
> seemingly by path_helper:
> https://github.com/apple-oss-distributions/zsh/blob/main/zprofile#L7C21-L7C32

Thank you! Yes, it indeed seems to be caused by path_helper.

macOS strikes again...




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