Home
last modified time | relevance | path

Searched hist:a6a3e8561d046a7e9cabc322c055903f47e5d880 (Results 1 – 2 of 2) sorted by relevance

/freebsd/usr.bin/man/
H A Dman.1diff a6a3e8561d046a7e9cabc322c055903f47e5d880 Fri Jun 03 16:34:38 CEST 2011 Ruslan Ermilov <ru@FreeBSD.org> 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.
H A Dman.shdiff a6a3e8561d046a7e9cabc322c055903f47e5d880 Fri Jun 03 16:34:38 CEST 2011 Ruslan Ermilov <ru@FreeBSD.org> 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.