From 2c2187b09d6dc488bb67968748ec07f7235a0238 Mon Sep 17 00:00:00 2001 From: cxy004 Date: Tue, 10 Jan 2023 04:02:51 +0800 Subject: [PATCH] fix(macos): fix `man-preview` for macOS Ventura (#11324) --- plugins/macos/macos.plugin.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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