Codex

TERMINAL_COLORS.D

Section: terminal-colors.d (5)

Updated: January 2014

Index?action=index Return to Main Contents


NAME

terminal-colors.d - Configure output colorization for various utilities

SYNOPSIS

/etc/terminal-colors.d/[[name][@term].][type]

DESCRIPTION

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:

disable
Turns off output colorization for all compatible utilities.:
enable
Turns on output colorization; any matching disable files are ignored.:
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 "[email protected]". The lowest priority are those files without a utility name and terminal identifier (e.g. "disable").

The user-specific $XDG_CONFIG_HOME/terminal-colors.d or $HOME/.config/terminal-colors.d overrides the global setting.

EXAMPLES

Disable colors for all compatible utilities:

:

touch /etc/terminal-colors.d/disable

:

Disable colors for all compatible utils on a vt100 terminal:

:

touch [email protected]

:

Disable colors for all compatible utils except dmesg?(1):

:

touch /etc/terminal-colors.d/disable

touch /etc/terminal-colors.d/dmesg.enable

:

DEFAULT SCHEME FILES FORMAT

The following statement is recognized:

:

name color-sequence

:

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.

The color-sequence is a color name, ASCII color sequences or escape sequences.

Color names

black, blue, brown, cyan, darkgray, gray, green, lightblue, lightcyan lightgray, lightgreen, lightmagenta, lightred, magenta, red and yellow

ANSI color sequences

The color sequences are composed of sequences of numbers separated by semicolons. The most common codes are:

:<TABLE> <TR VALIGN="top| <TD>

 0</TD> <TD>to restore default color

</TD> </TR> <TR VALIGN="top| <TD>

 1</TD> <TD>for brighter colors

</TD> </TR> <TR VALIGN="top| <TD>

 4</TD> <TD>for underlined text

</TD> </TR> <TR VALIGN="top| <TD>

 5</TD> <TD>for flashing text

</TD> </TR> <TR VALIGN="top| <TD>30</TD> <TD>for black foreground

</TD> </TR> <TR VALIGN="top| <TD>31</TD> <TD>for red foreground

</TD> </TR> <TR VALIGN="top| <TD>32</TD> <TD>for green foreground

</TD> </TR> <TR VALIGN="top| <TD>33</TD> <TD>for yellow (or brown) foreground

</TD> </TR> <TR VALIGN="top| <TD>34</TD> <TD>for blue foreground

</TD> </TR> <TR VALIGN="top| <TD>35</TD> <TD>for purple foreground

</TD> </TR> <TR VALIGN="top| <TD>36</TD> <TD>for cyan foreground

</TD> </TR> <TR VALIGN="top| <TD>37</TD> <TD>for white (or gray) foreground

</TD> </TR> <TR VALIGN="top| <TD>40</TD> <TD>for black background

</TD> </TR> <TR VALIGN="top| <TD>41</TD> <TD>for red background

</TD> </TR> <TR VALIGN="top| <TD>42</TD> <TD>for green background

</TD> </TR> <TR VALIGN="top| <TD>43</TD> <TD>for yellow (or brown) background

</TD> </TR> <TR VALIGN="top| <TD>44</TD> <TD>for blue background

</TD> </TR> <TR VALIGN="top| <TD>45</TD> <TD>for purple background

</TD> </TR> <TR VALIGN="top| <TD>46</TD> <TD>for cyan background

</TD> </TR> <TR VALIGN="top| <TD>47</TD> <TD>for white (or gray) background

</TD> </TR> </TABLE> :

Escape sequences

To specify control or blank characters in the color sequences, C-style \-escaped notation can be used:

:<TABLE> <TR VALIGN="top| <TD CLASS="c2|\a</TD> <TD>Bell (ASCII 7)

</TD> </TR> <TR VALIGN="top| <TD CLASS="c2|\b</TD> <TD>Backspace (ASCII 8)

</TD> </TR> <TR VALIGN="top| <TD CLASS="c2|\e</TD> <TD>Escape (ASCII 27)

</TD> </TR> <TR VALIGN="top| <TD CLASS="c2|\f</TD> <TD>Form feed (ASCII 12)

</TD> </TR> <TR VALIGN="top| <TD CLASS="c2|\n</TD> <TD>Newline (ASCII 10)

</TD> </TR> <TR VALIGN="top| <TD CLASS="c2|\r</TD> <TD>Carriage Return (ASCII 13)

</TD> </TR> <TR VALIGN="top| <TD CLASS="c2|\t</TD> <TD>Tab (ASCII 9)

</TD> </TR> <TR VALIGN="top| <TD CLASS="c2|\v</TD> <TD>Vertical Tab (ASCII 11)

</TD> </TR> <TR VALIGN="top| <TD CLASS="c2|\?</TD> <TD>Delete (ASCII 127)

</TD> </TR> <TR VALIGN="top| <TD CLASS="c2|\_</TD> <TD>Space

</TD> </TR> <TR VALIGN="top| <TD CLASS="c2|\\</TD> <TD>Backslash (\)

</TD> </TR> <TR VALIGN="top| <TD CLASS="c2|\^</TD> <TD>Caret (^)

</TD> </TR> <TR VALIGN="top| <TD CLASS="c2|\#</TD> <TD>Hash mark (#)

</TD> </TR> </TABLE> :

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

:

FILES

$XDG_CONFIG_HOME/terminal-colors.d

$HOME/.config/terminal-colors.d

/etc/terminal-colors.d

COMPATIBILITY

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.

AVAILABILITY

terminal-colors.d is part of the util-linux package and is available from Linux Kernel Archive


Index

NAME

SYNOPSIS

DESCRIPTION

EXAMPLES

DEFAULT SCHEME FILES FORMAT

Color names

ANSI color sequences

Escape sequences

FILES

COMPATIBILITY

AVAILABILITY