1 //po4a: entry man manual
4 Copyright 2014 Ondrej Oprala <ooprala@redhat.com>
5 Copyright (C) 2014 Karel Zak <kzak@redhat.com>
6 Copyright 2014 Red Hat, Inc.
7 May be distributed under the GNU General Public License
10 = terminal-colors.d(5)
12 :man manual: File formats
13 :man source: util-linux {release-version}
15 :configfile: terminal-colors.d
19 terminal-colors.d - configure output colorization for various utilities
23 /etc/terminal-colors.d/_[[name][@term].][type]_
27 Files in this directory determine the default behavior for utilities when coloring output.
29 The _name_ is a utility name. The name is optional and when none is specified then the file is used for all unspecified utilities.
31 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.
33 The _type_ is a file type. Supported file types are:
36 Turns off output colorization for all compatible utilities.
39 Turns on output colorization; any matching *disable* files are ignored.
42 Specifies colors used for output. The file format may be specific to the utility, the default format is described below.
44 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").
46 The user-specific _$XDG_CONFIG_HOME/terminal-colors.d_ or _$HOME/.config/terminal-colors.d_ overrides the global setting.
48 == DEFAULT SCHEME FILES FORMAT
50 The following statement is recognized:
56 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.
58 The *color-sequence* is a color name, ASCII color sequences or escape sequences.
62 black, blink, blue, bold, brown, cyan, darkgray, gray, green, halfbright, lightblue, lightcyan, lightgray, lightgreen, lightmagenta, lightred, magenta, red, reset, reverse, and yellow.
64 === ANSI color sequences
66 The color sequences are composed of sequences of numbers separated by semicolons. The most common codes are:
71 |0 |to restore default color
72 |1 |for brighter colors
73 |4 |for underlined text
75 |30 |for black foreground
76 |31 |for red foreground
77 |32 |for green foreground
78 |33 |for yellow (or brown) foreground
79 |34 |for blue foreground
80 |35 |for purple foreground
81 |36 |for cyan foreground
82 |37 |for white (or gray) foreground
83 |40 |for black background
84 |41 |for red background
85 |42 |for green background
86 |43 |for yellow (or brown) background
87 |44 |for blue background
88 |45 |for purple background
89 |46 |for cyan background
90 |47 |for white (or gray) background
96 To specify control or blank characters in the color sequences, C-style \-escaped notation can be used:
101 |*\a* |Bell (ASCII 7)
102 |*\b* |Backspace (ASCII 8)
103 |*\e* |Escape (ASCII 27)
104 |*\f* |Form feed (ASCII 12)
105 |*\n* |Newline (ASCII 10)
106 |*\r* |Carriage Return (ASCII 13)
108 |*\v* |Vertical Tab (ASCII 11)
109 |*\?* |Delete (ASCII 127)
117 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.
119 For example, to use a red background for alert messages in the output of *dmesg*(1), use:
122 *echo 'alert 37;41' >> /etc/terminal-colors.d/dmesg.scheme*
127 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.
131 *TERMINAL_COLORS_DEBUG*=all::
132 enables debug output.
136 _$XDG_CONFIG_HOME/terminal-colors.d_
138 _$HOME/.config/terminal-colors.d_
140 _/etc/terminal-colors.d_
144 Disable colors for all compatible utilities:
147 *touch /etc/terminal-colors.d/disable*
150 Disable colors for all compatible utils on a vt100 terminal:
153 *touch /etc/terminal-colors.d/@vt100.disable*
156 Disable colors for all compatible utils except *dmesg*(1):
159 *touch /etc/terminal-colors.d/disable*
161 *touch /etc/terminal-colors.d/dmesg.enable*
166 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.
168 include::man-common/bugreports.adoc[]
170 include::man-common/footer-config.adoc[]
173 include::man-common/translation.adoc[]