From 95b19823b7a7c9dacf41301a18ab2e207e802c58 Mon Sep 17 00:00:00 2001 From: Matthew Heller Date: Tue, 10 Oct 2023 01:18:03 -0500 Subject: [PATCH] Tips-N'-Tricks: homebrew.man.conf for Terminal.app Add instructions for fixing Terminal.app's "Open man Page" command by creating homebrew.man.conf. --- docs/Tips-N'-Tricks.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/Tips-N'-Tricks.md b/docs/Tips-N'-Tricks.md index d13f571e78..32a02adc5f 100644 --- a/docs/Tips-N'-Tricks.md +++ b/docs/Tips-N'-Tricks.md @@ -104,3 +104,19 @@ $ brew install --cask --adopt textmate - [homebrew-mode](https://github.com/dunn/homebrew-mode) provides syntax highlighting for inline patches as well as a number of helper functions for editing formula files. - [pcmpl-homebrew](https://github.com/hiddenlotus/pcmpl-homebrew) provides completion for emacs shell-mode and eshell-mode. + +## Terminal.app: Enable the "Open man Page" contextual menu item + +In the macOS Terminal, you can right-click on a command name (like `ls` or `tar`) and pop open its manpage in a new window by selecting "Open man Page". + +Terminal needs an extra hint on where to find manpages installed by Homebrew because it doesn't load normal dotfiles like `~/.bash_profile` or `~/.zshrc`. + +```console +$ sudo mkdir -p /usr/local/etc/man.d +$ sudo nano /usr/local/etc/man.d/homebrew.man.conf +``` +Add the following to the new file `homebrew.man.conf`: +``` +### Homebrew +MANPATH /opt/homebrew/share/man +```