2

On macOS man uses the pager "/usr/bin/less -is" (see man's man page). When I type man , I see colorized output, and I like this. But, I prefer to use the terminal's find commands when using man, and see less's paging behavior as an obstacle.

If I set the pager to cat, I lose coloring.

How can I disable paging, but keep coloring?

  • I don't have macOS to try it on, but you could also try unsetting PAGER and MANPAGER or setting them to the empty string. – meuh Nov 2 '18 at 16:31
  • Good idea. I checked, and PAGER and MANPAGER are both unset in my shell sessions. If I explicitly set them to empty strings, man fails to run. – Jon Hess Nov 3 '18 at 0:18
  • The Fedora man man page says if you set MAN_KEEP_FORMATTING=1 in the environment, output to a pipe will keep formatting chars. – meuh Nov 3 '18 at 17:32
  • That sounded promising, but "MAN_KEEP_FORMATTING=1 man man | cat" executed from a bash shell results in unformatted output. "man man" on macOS doesn't mention MAN_KEEP_FORMATTING. – Jon Hess Nov 8 '18 at 7:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.