summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorApril King <april@pokeinthe.io>2021-09-28 04:40:31 -0500
committerGitHub <noreply@github.com>2021-09-28 11:40:31 +0200
commit4ae5bdebc36068a53fbc38a4e0d6d97e49f5b56c (patch)
tree1d5c1d70710475ce4d2ab4b196ddd888fc4973c1 /plugins
parent33c86fe80b5d838b3d3dd454c35aa94f4a38b3f7 (diff)
downloadzsh-4ae5bdebc36068a53fbc38a4e0d6d97e49f5b56c.tar.gz
zsh-4ae5bdebc36068a53fbc38a4e0d6d97e49f5b56c.tar.bz2
zsh-4ae5bdebc36068a53fbc38a4e0d6d97e49f5b56c.zip
fix(osx): only run Preview.app in `man-preview` if man page exists (#10222)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/osx/osx.plugin.zsh3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh
index 7842e9f73..5455d7c5f 100644
--- a/plugins/osx/osx.plugin.zsh
+++ b/plugins/osx/osx.plugin.zsh
@@ -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