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