Justin Su
Justin Su
> It seems weird to me that Ghosttty would set $MANPATH just to its own path, in systems I know this would override the system default manpath. @faho I missed...
> As the comment says: This is what macOS' [path_helper](https://opensource.apple.com/source/shell_cmds/shell_cmds-203/path_helper/path_helper.c.auto.html) does in login shells, so we do the same thing. `__fish_macos_set_env` leaves appended values as appended, but I noticed that...
If I'm reading the `path_helper` source correctly, `append_path_segment` [drops empty segments](https://github.com/apple-opensource-mirror/shell_cmds/blob/4ea11424b80a117ad1e401867b1453bb2362feb3/path_helper/path_helper.c#L45). So when processing Ghostty's `:/Applications/Ghostty.app/Contents/Resources/ghostty/../man`, the leading `:` is effectively dropped. So it appends `/usr/share/man`, `/usr/local/share/man`, and then `/Applications/Ghostty.app/Contents/Resources/ghostty/../man`,...
Oh, hmm. I have no idea then. Somehow I am getting ```/usr/share/man:/usr/local/share/man::/Applications/Ghostty.app/Contents/Resources/ghostty/../man``` from fish, and I don't know why. zsh (which I believe actually runs `path_helper`) gives me ``` /usr/share/man:/usr/local/share/man:/Applications/Ghostty.app/Contents/Resources/ghostty/../man:...
I'm using fish 4.0.0 now, which includes https://github.com/fish-shell/fish-shell/commit/95d61ea0fbd90ed01b6ea39a790ca0d1b6a14689 and so this should be fixed. But the MANPATH behaviour hasn't changed and I'm still getting the same MANPATH as https://github.com/fish-shell/fish-shell/issues/10684#issuecomment-2564331523. @westernwontons...
> But the MANPATH behaviour hasn't changed and I'm still getting the same MANPATH as [#10684 (comment)](https://github.com/fish-shell/fish-shell/issues/10684#issuecomment-2564331523). I'm using fish 4.0.2 (which hopefully includes the fix) but my MANPATH still...
On fish 4.1.2 now, with this added to the beginning and end of `__fish_macos_set_env`: ```fish if test "$argv[1]" = MANPATH echo \$MANPATH = "$MANPATH" end ``` outputs: ``` $MANPATH =...
> ok I think I'm close to a fix for the extra middle colon, but where does the extra colon at the end come from? [apple-opensource-mirror/shell_cmds@`4ea1142`/path_helper/path_helper.c (raw)](https://raw.githubusercontent.com/apple-opensource-mirror/shell_cmds/4ea11424b80a117ad1e401867b1453bb2362feb3/path_helper/path_helper.c) doesn't seem to...
When I compile the code myself, the output is different from the `path_helper` that ships with macOS... ```fish $ MANPATH= ./a.out | grep MANPATH MANPATH="/usr/share/man:/usr/local/share/man"; export MANPATH; $ MANPATH= /usr/libexec/path_helper...
Seems like https://raw.githubusercontent.com/apple-opensource-mirror/shell_cmds/4ea11424b80a117ad1e401867b1453bb2362feb3/path_helper/path_helper.c is outdated. https://github.com/apple-oss-distributions/shell_cmds/blob/main/path_helper/path_helper.c gives me behaviour matching the `/usr/libexec/path_helper` shipped with macOS. It explicitly adds the trailing colon in `main()`.