Third party man pages in touch bar

manterminaltouch-bar

The yellow man feature of the touch bar does not seem to use manpath,
for example /opt/homebrew/share/man/ is ignored. How do you configure this?

Best Answer

You need to add a MANPATH entry to /private/etc/man.conf as follows:

MANPATH /opt/homebrew/share/man

This will direct man to include the specified path directory in the search path (from man man):

If you don't specify an explicit path list with -M or [the] MANPATH [environment variable], man develops its own path list based on the contents of the configuration file /private/etc/man.conf. The MANPATH statements in the configuration file identify particular directories to include in the search path.

If have tested it in Big Sur and it works.

Why doesn't man honor the MANPATH environment variable in this case? When you look for a man page by pressing the "Open man Page for Selection" option in the Touch Bar, a process like the following is executed:

login -pfq <username> /usr/bin/man -P ul <command>

where:

  • username is your username
  • command is the command whose man page you want to display

login starts man directly, and it is not aware of the value of the MANPATH variable.