summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcxy004 <cxy004@qq.com>2023-01-10 04:02:51 +0800
committerGitHub <noreply@github.com>2023-01-09 20:02:51 +0000
commit2c2187b09d6dc488bb67968748ec07f7235a0238 (patch)
tree4f8e6c7fab8e9ca3676177808bce40d4716df0c3
parente0d0dfb845a8f1eb35bce8ca5afcd76cb2ffbb35 (diff)
downloadzsh-2c2187b09d6dc488bb67968748ec07f7235a0238.tar.gz
zsh-2c2187b09d6dc488bb67968748ec07f7235a0238.tar.bz2
zsh-2c2187b09d6dc488bb67968748ec07f7235a0238.zip
fix(macos): fix `man-preview` for macOS Ventura (#11324)
-rw-r--r--plugins/macos/macos.plugin.zsh3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/macos/macos.plugin.zsh b/plugins/macos/macos.plugin.zsh
index b540eecb5..e4d759dcf 100644
--- a/plugins/macos/macos.plugin.zsh
+++ b/plugins/macos/macos.plugin.zsh
@@ -224,8 +224,9 @@ function quick-look() {
}
function man-preview() {
+ local location
# 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 "$@"
+ location=$(man -w "$@") && mandoc -Tpdf $location | open -f -a Preview
}
compdef _man man-preview