fix(osx): only run Preview.app in `man-preview` if man page exists (#10222)

pull/10228/head
April King 2021-09-28 04:40:31 -05:00 committed by GitHub
parent 33c86fe80b
commit 4ae5bdebc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -219,7 +219,8 @@ function quick-look() {
}
function man-preview() {
man -t "$@" | open -f -a Preview
# Don't let Preview.app steal focus if the man page doesn't exist
man -w "$@" &>/dev/null && man -t "$@" | open -f -a Preview || man "$@"
}
compdef _man man-preview