From a6c8cd6e85f5f7092b47e28e9963cb3268a2b5be Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Tue, 10 Sep 2024 16:37:07 -0700 Subject: [PATCH] Fix `man` completions on macOS with symlinked `manpath` When `manpath` prints a symlink to a directory, `/usr/libexec/makewhatis` ignores the entire directory: ``` $ /usr/libexec/makewhatis -o /tmp/whatis \ (/usr/bin/manpath | string split :) makewhatis: /Users/wiggles/.nix-profile/share/man: Not a directory ``` This means that the built-in `man` completions will not index any commands in these directories. If we pass the directories to `readlink -f` first, `makewhatis` correctly indexes the `man` pages. ``` $ /usr/libexec/makewhatis -o /tmp/whatis \ (/usr/bin/manpath | string split : | xargs readlink -f) ``` --- share/functions/__fish_apropos.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/functions/__fish_apropos.fish b/share/functions/__fish_apropos.fish index 0e4d1a697..21026adc6 100644 --- a/share/functions/__fish_apropos.fish +++ b/share/functions/__fish_apropos.fish @@ -40,7 +40,7 @@ if test $status -eq 0 -a (count $sysver) -eq 3 if test $age -ge $max_age test -d "$dir" || mkdir -m 700 -p $dir - /usr/libexec/makewhatis -o "$whatis" (/usr/bin/manpath | string split :) >/dev/null 2>&1 /dev/null 2>&1