How to set $MANPATH
or manpath
for the macOS Terminal Help menu command: Open man Page for Selection?
Having recently done a clean install of macOS Mojave (10.14.6), I am trying to get my macOS Terminal.app configured. The trouble is with the Terminal menu command Open man Page or Open man Page for Selection and its associated service available system wide in the Services menu. I would like to configure the manpath
that the menu command is using to be the same as my bash shell.
The standard /usr/bin/man
command works great from my shell. But I like to be able to select a word or topic or command in the Terminal and right click. The context menu has Open man Page and Services ► Open man Page in Terminal. I use the last one a lot becase it works anywhere. The menu command opens a new window in Terminal containing the complete formatted man page text, with a special window profile / color scheme, without disturbing my current shell session.
My specific problem is illustrated as follows. If I select "bash", right click, and Open man Page, then the man page I get is for bash 3.2. It is almost certainly the from /usr/share/man/man1/bash.1
.
If I type man bash
in the Terminal shell, I get the man page for bash 5.0: /usr/local/share/man/man1/bash.1
. Typing man -aw bash, I get
$ man -aw bash
/usr/local/share/man/man1/bash.1
/usr/share/man/man1/bash.1
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/share/man/man1/bash.1
If I type manpath, replacing colons with newlines, I get
$ manpath | perl -nE 's/:/\n/g; print'
/opt/local/share/man
/usr/local/share/man
/usr/share/man
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/share/man
/Applications/Xcode.app/Contents/Developer/usr/share/man
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/man
/usr/local/opt/ack/share/man
I don’t know how to query the Terminal for manpath it is using, or configure it. Please help with any advice on how to configure the Terminal menu command Open man Page for Selection.
More information:
cbedgar@CBmac: ~ | 14:22:38 | -bash5.0.11
293$ man -d
Reading config file /private/etc/man.conf
Looked whether there exists a message catalog man, but there is none
(and for English messages none is needed)
found man directory /usr/local/share/man
found man directory /opt/local/share/man
found man directory /usr/share/man
found man directory /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/share/man
found man directory /Applications/Xcode.app/Contents/Developer/usr/share/man
found man directory /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/man
found man directory /usr/local/opt/ack/share/man
found man directory /usr/local/opt/bash/share/man
found man directory /usr/local/opt/gdbm/share/man
found man directory /usr/local/opt/gettext/share/man
found man directory /usr/local/opt/gnupg/share/man
found man directory /usr/local/opt/gnupg2/share/man
found man directory /usr/local/opt/[email protected]/share/man
found man directory /usr/local/opt/gnutls/share/man
found man directory /usr/local/opt/gpg/share/man
found man directory /usr/local/opt/gpg2/share/man
found man directory /usr/local/opt/grep/share/man
found man directory /usr/local/opt/jq/share/man
found man directory /usr/local/opt/libevent/share/man
found man directory /usr/local/opt/libffi/share/man
found man directory /usr/local/opt/libgcrypt/share/man
found man directory /usr/local/opt/libgpg-error/share/man
found man directory /usr/local/opt/libidn2/share/man
found man directory /usr/local/opt/libtasn/share/man
found man directory /usr/local/opt/libtasn1/share/man
found man directory /usr/local/opt/libxml2/share/man
found man directory /usr/local/opt/openssl/share/man
found man directory /usr/local/opt/[email protected]/share/man
found man directory /usr/local/opt/pandoc/share/man
found man directory /usr/local/opt/pcre/share/man
found man directory /usr/local/opt/pcre1/share/man
found man directory /usr/local/opt/perl/share/man
found man directory /usr/local/opt/[email protected]/share/man
found man directory /usr/local/opt/pure-ftpd/share/man
found man directory /usr/local/opt/python/share/man
found man directory /usr/local/opt/python2/share/man
found man directory /usr/local/opt/python3/share/man
found man directory /usr/local/opt/python@2/share/man
found man directory /usr/local/opt/python@3/share/man
found man directory /usr/local/opt/readline/share/man
found man directory /usr/local/opt/sqlite/share/man
found man directory /usr/local/opt/sqlite3/share/man
found man directory /usr/local/opt/unbound/share/man
found man directory /usr/local/opt/xz/share/man
found manpath map /bin --> /usr/share/man
found manpath map /sbin --> /usr/share/man
found manpath map /usr/bin --> /usr/share/man
found manpath map /usr/sbin --> /usr/share/man
found manpath map /usr/local/bin --> /usr/local/share/man
found manpath map /usr/local/sbin --> /usr/local/share/man
found manpath map /usr/X11/bin --> /usr/X11/man
found manpath map /usr/bin/X11 --> /usr/X11/man
found manpath map /usr/bin/mh --> /usr/share/man
using /usr/bin/less -is as pager
using /usr/bin/less -is as browser
using /bin/cat to dump HTML pages as textWhat manual page do you want?
man manpath
orman man
to see details./private/etc/man.conf
is where the configuration file sits. I just saw this thing for the first time, so cannot add more.man -d
?/etc/manpaths
or adding a file to/etc/manpaths.d/
and rebooting to no avail. Editing/etc/man.conf
was a great thought, so I just tried adding my changes and rebooting. No difference. I still get the wrong bash manual. THANK YOU for the suggestions however.