Index of /s/manpager/
MANPAGER(1) General Commands Manual MANPAGER(1)
NAME
manpager – colourize manpages
SYNOPSIS
manpager
DESCRIPTION
manpager is a small wrapper around less(1), setting up its termcap
variables in order to remove escape sequences which would otherwise
pollute the user's environment. To use it with man(1), just set the
MANPAGER variable appropriately. It can also be used in place of calls
to less(1).
ENVIRONMENT
MANPAGER_COLORS A comma-separated list of capabilities in the form of
name=value, where name is a termcap capability, and
value is zero or more SGR parameters. For each
capability, manpager will set the respective
LESS_TERMCAP variable to an SGR sequence containing the
provided parameters.
A non-exhaustive list of supported capabilities is as
follows:
md Start bold mode. mandoc(1) uses this for things
such as section headers, flags and paths.
me End all modes. This includes us, so, and md,
amongst others. Should be set if any mode is set.
us Start underlining. mandoc(1) uses this for things
such as arguments, program names and references.
ue End underlining. Should be set if us is set.
so Start standout mode. Also known as 'reverse video
mode'; less(1) uses this to highlight search
results.
se End standout mode. Should be set if so is set.
EXAMPLES
The following demonstrates the intended usage, along with the author's
preferred configuration:
export MANPAGER_COLORS='md=31,me=,us=4;35,ue='
export MANPAGER=manpager
man manpager
This causes man(1) to run manpager, which will set the variables listed
below and then display the manpage using less(1).
LESS_TERMCAP_md=$'\033[31m'
LESS_TERMCAP_me=$'\033[m'
LESS_TERMCAP_us=$'\033[4;35m'
LESS_TERMCAP_ue=$'\033[m'
SEE ALSO
less(1), man(1), mandoc(1), termcap(5)
HISTORY
manpager was created due to frustration with environments containing SGR
escape sequences that would cause terminal output pollution when printed.
Gentoo's manpager(1) was considered as a solution, but ultimately proved
to be inconvenient, since it contained hard-coded escape sequences.
Thus, this program was born.
AUTHORS
manpager was written by Erin Kinsley <ybden@ybden.net>, with input from
Wolfgang Müller <vehk@vehk.de>; and with additional feedback from Jonas
Höglund <firefly@firefly.nu>, who did not wish to appear here, but was
spitefully added nonetheless.
April 21, 2017