blob: 66ecf2c4860278a3cc283dafb00b1b0e922b7669 [file] [log] [blame]
.\" terminal-colors.d.5 --
.\" Copyright 2014 Ondrej Oprala <>
.\" Copyright (C) 2014 Karel Zak <>
.\" Copyright 2014 Red Hat, Inc.
.\" May be distributed under the GNU General Public License
.TH "TERMINAL_COLORS.D" "5" "January 2014" "util-linux" "terminal-colors.d"
terminal-colors.d \- Configure output colorization for various utilities
Files in this directory determine the default behavior for utilities
when coloring output.
.I name
is a utility name. The name is optional and when none is specified then the
file is used for all unspecified utilities.
.I 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.
.I type
is a file type. Supported file types are:
.B disable
Turns off output colorization for all compatible utilities.
.B enable
Turns on output colorization; any matching
.B disable
files are ignored.
.B scheme
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@xterm.scheme". The lowest priority are those files without a
utility name and terminal identifier (e.g. "disable").
The user-specific
.I $XDG_CONFIG_HOME/terminal-colors.d
.I $HOME/.config/terminal-colors.d
overrides the global setting.
Disable colors for all compatible utilities:
.B "touch /etc/terminal-colors.d/disable"
Disable colors for all compatible utils on a vt100 terminal:
.B "touch /etc/terminal-colors.d/@vt100.disable"
Disable colors for all compatible utils except dmesg(1):
.B "touch /etc/terminal-colors.d/disable"
.B "touch /etc/terminal-colors.d/dmesg.enable"
The following statement is recognized:
.B "name color-sequence"
.B 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.
.B color-sequence
is a color name, ASCII color sequences or escape sequences.
.SS Color names
black, blue, brown, cyan, darkgray, gray, green, lightblue, lightcyan
lightgray, lightgreen, lightmagenta, lightred, magenta, red and yellow
.SS ANSI color sequences
The color sequences are composed of sequences of numbers
separated by semicolons. The most common codes are:
l l.
0 to restore default color
1 for brighter colors
4 for underlined text
5 for flashing text
30 for black foreground
31 for red foreground
32 for green foreground
33 for yellow (or brown) foreground
34 for blue foreground
35 for purple foreground
36 for cyan foreground
37 for white (or gray) foreground
40 for black background
41 for red background
42 for green background
43 for yellow (or brown) background
44 for blue background
45 for purple background
46 for cyan background
47 for white (or gray) background
.SS Escape sequences
To specify control or blank characters in the color sequences,
C-style \e-escaped notation can be used:
lb l.
\ea Bell (ASCII 7)
\eb Backspace (ASCII 8)
\ee Escape (ASCII 27)
\ef Form feed (ASCII 12)
\en Newline (ASCII 10)
\er Carriage Return (ASCII 13)
\et Tab (ASCII 9)
\ev Vertical Tab (ASCII 11)
\e? Delete (ASCII 127)
\e_ Space
\e\e Backslash (\e)
\e^ Caret (^)
\e# 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
.BR dmesg (1),
.B "echo 'alert 37;41' >> /etc/terminal-colors.d/dmesg.scheme"
.SS Comments
Lines where the first non-blank character is a # (hash) are ignored.
Any other use of the hash character is not interpreted as introducing
a comment.
.B $XDG_CONFIG_HOME/terminal-colors.d
.B $HOME/.config/terminal-colors.d
.B /etc/terminal-colors.d
enables debug output.
The terminal-colors.d functionality is currently supported by all util-linux
utilities which provides colorized output. For more details always see the
COLORS section in the man page for the utility.
terminal-colors.d is part of the util-linux package and is available from
.UR ftp://\\:/pub\:/linux\:/utils\:/util-linux/
Linux Kernel Archive
.UE .