浏览代码

fix(macos): fix `man-preview` for macOS Ventura (#11324)

cxy004 2 年之前
父节点
当前提交
2c2187b09d
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      plugins/macos/macos.plugin.zsh

+ 2 - 1
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