mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 13:39:02 +00:00
Work around BSD man calling pager when stdout is not a TTY
With BSD man, "PAGER=vim man man | cat" hangs because [man](https://cgit.freebsd.org/src/tree/usr.bin/man/man.sh) wrongly calls the pager even though stdout is not a terminal. This hang manifests in places where we call apropos in a subshell, such as in "complete -Ccar". Let's work around this I guess. This should really be fixed upstream because it's a problem in every app that wants to display man pages but doesn't emulate a complete terminal. Weirdly, the Apple derivative of man.sh uses WHATISPAGER instead of MANPAGER. Closes #10820
This commit is contained in:
parent
31d7f197b1
commit
ec939fb22f
1 changed files with 2 additions and 2 deletions
|
@ -36,7 +36,7 @@ if test $status -eq 0 -a (count $sysver) -eq 3
|
|||
set age (path mtime -R -- $whatis)
|
||||
end
|
||||
|
||||
MANPATH="$dir" apropos "$argv"
|
||||
MANPATH="$dir" MANPAGER=cat WHATISPAGER=cat apropos "$argv"
|
||||
|
||||
if test $age -ge $max_age
|
||||
test -d "$dir" || mkdir -m 700 -p $dir
|
||||
|
@ -48,6 +48,6 @@ else
|
|||
function __fish_apropos
|
||||
# we only ever prefix match for completions. This also ensures results for bare apropos <TAB>
|
||||
# (apropos '' gives no results, but apropos '^' lists all manpages)
|
||||
apropos "$argv"
|
||||
MANPAGER=cat WHATISPAGER=cat apropos "$argv"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue