Apple has some custom URLs defined and one of them is x-man-page
. If you open a particular man page with it, it displays it in a nice yellow window (a provided profile for Terminal) with black text.
open x-man-page://man
Side note: You can even put this on a web-page and it will automatically open the man page in the URL. It was "categorized" as a security issue (Stack Exchange prohibits the URL), but at most it's a nuisance. Same goes for the dictionary app: open x-dictionary:apple
, but I digress...
What's nice about it is that it's a separate window and it has it's own predefined profile that can be customized (but I like the default)*. This is the same functionality if you select a command in Terminal with your mouse, right click and select "Open man page".
I would like to this to work in iTerm2
Using RCDefault App I set the application for x-man-page
and when I issue the command, it does open a new iTerm tab, but it displays nothing.
Does anyone know how to get iTerm2 to respond to this?
*I liked it so much, I wrote this function in my .bash_profile
so that if I type man <command>
it shows up as if I typed open x-man-page://<command>
function man {
if [ $# -eq 1 ] ; then
open x-man-page://$1 ;
elif [ $# -eq 2 ] ; then
open x-man-page://$1/$2 ;
fi
}
port install ManOpen
does this - But seemingly not on Monterey - I have used it for 15+ years. The original site appears to be missing as well but there are forks on GitHub