freebsd-nq/usr.bin/man
Ruslan Ermilov a6a3e8561d When MANCOLOR environment variable is set, enable ANSI color escapes
in grotty(1).  This makes it possible to view colorized manpages in
color.

When MANPAGER environment variable is set, use it instead of PAGER.

Why another environment variable, one might ask?  With color output
enabled, both a terminal and a pager should support the ANSI color
escapes.  On a supporting terminal, less(1) with option -R would be
such a pager, while "more -s" (the current default pager for man(1))
will show garbage.  It means a different default pager is needed when
color output is enabled, but many people have PAGER set customary,
and it's unlikely to support ANSI color escapes, so introducing yet
another variable (MANPAGER) seemed like a good option to me:

- if MANPAGER is set, use that unconditionally;

- if you disable color support (it is by default), and don't set
  MANPAGER, you get an old behavior: -P pager, $PAGER, "more -s",
  in that order;

- if you enable color support (by setting MANCOLOR), and don't set
  MANPAGER, we ignore PAGER which is unlikely to support ANSI color
  escapes, and you get: -P pager, "less -Rs", in that order;

- you might have good reasons for different man(1) and general
  purpose pagers;

- later versions of GNU man(1) support MANPAGER.
2011-06-03 14:34:38 +00:00
..
apropos.1
Makefile
man.1 When MANCOLOR environment variable is set, enable ANSI color escapes 2011-06-03 14:34:38 +00:00
man.conf.5 Don't use col(1) since grotty(1) never outputs reverse line feeds, 2011-06-03 13:45:11 +00:00
man.sh When MANCOLOR environment variable is set, enable ANSI color escapes 2011-06-03 14:34:38 +00:00
manpath.1 SEE ALSO should sorted by manpage section first. 2010-10-05 20:39:36 +00:00