terminal-colors.d (5) - Linux Manuals
terminal-colors.d: configure output colorization for various utilities
terminal-colors.d - configure output colorization for various utilities
Files in this directory determine the default behavior for utilities when coloring output.
The name is a utility name. The name is optional and when none is specified then the file is used for all unspecified utilities.
The term is a terminal identifier (the TERM environment variable). The terminal identifier is optional and when none is specified then the file is used for all unspecified terminals.
The type is a file type. Supported file types are:
- Turns off output colorization for all compatible utilities.
- Turns on output colorization; any matching disable files are ignored.
- Specifies colors used for output. The file format may be specific to the utility, the default format is described below.
If there are more files that match for a utility, then the file with the more specific filename wins. For example, the filename "@xterm.scheme" has less priority than "dmesg [at] xterm.scheme". The lowest priority are those files without a utility name and terminal identifier (e.g., "disable").
DEFAULT SCHEME FILES FORMAT
The following statement is recognized:
The name is a logical name of color sequence (for example "error"). The names are specific to the utilities. For more details always see the COLORS section in the man page for the utility.
ANSI color sequences
The color sequences are composed of sequences of numbers separated by semicolons. The most common codes are:
to restore default color
for brighter colors
for underlined text
for flashing text
for black foreground
for red foreground
for green foreground
for yellow (or brown) foreground
for blue foreground
for purple foreground
for cyan foreground
for white (or gray) foreground
for black background
for red background
for green background
for yellow (or brown) background
for blue background
for purple background
for cyan background
for white (or gray) background
To specify control or blank characters in the color sequences, C-style \-escaped notation can be used:
Bell (ASCII 7)
Backspace (ASCII 8)
Escape (ASCII 27)
Form feed (ASCII 12)
Newline (ASCII 10)
Carriage Return (ASCII 13)
Tab (ASCII 9)
Vertical Tab (ASCII 11)
Delete (ASCII 127)
Hash mark (#)
Please note that escapes are necessary to enter a space, backslash, caret, or any control character anywhere in the string, as well as a hash mark as the first character.
For example, to use a red background for alert messages in the output of dmesg(1), use:
echo 'alert 37;41' >> /etc/terminal-colors.d/dmesg.scheme
- enables debug output.
Disable colors for all compatible utilities:
Disable colors for all compatible utils on a vt100 terminal:
Disable colors for all compatible utils except dmesg(1):
For bug reports, use the issue tracker at <https://github.com/karelzak/util-linux/issues>.
terminal-colors.d is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.