1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
|
'\" t
.\" Title: terminal-colors.d
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.15
.\" Date: 2022-05-11
.\" Manual: File formats
.\" Source: util-linux 2.38.1
.\" Language: English
.\"
.TH "TERMINAL\-COLORS.D" "5" "2022-05-11" "util\-linux 2.38.1" "File formats"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
.nh
.ad l
.de URL
\fI\\$2\fP <\\$1>\\$3
..
.als MTO URL
.if \n[.g] \{\
. mso www.tmac
. am URL
. ad l
. .
. am MTO
. ad l
. .
. LINKSTYLE blue R < >
.\}
.SH "NAME"
terminal-colors.d \- configure output colorization for various utilities
.SH "SYNOPSIS"
.sp
/etc/terminal\-colors.d/\fI[[name][@term].][type]\fP
.SH "DESCRIPTION"
.sp
Files in this directory determine the default behavior for utilities when coloring output.
.sp
The \fIname\fP is a utility name. The name is optional and when none is specified then the file is used for all unspecified utilities.
.sp
The \fIterm\fP is a terminal identifier (the \fBTERM\fP environment variable). The terminal identifier is optional and when none is specified then the file is used for all unspecified terminals.
.sp
The \fItype\fP is a file type. Supported file types are:
.sp
\fBdisable\fP
.RS 4
Turns off output colorization for all compatible utilities.
.RE
.sp
\fBenable\fP
.RS 4
Turns on output colorization; any matching \fBdisable\fP files are ignored.
.RE
.sp
\fBscheme\fP
.RS 4
Specifies colors used for output. The file format may be specific to the utility, the default format is described below.
.RE
.sp
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").
.sp
The user\-specific \fI$XDG_CONFIG_HOME/terminal\-colors.d\fP or \fI$HOME/.config/terminal\-colors.d\fP overrides the global setting.
.SH "DEFAULT SCHEME FILES FORMAT"
.sp
The following statement is recognized:
.RS 3
.ll -.6i
.sp
\fBname color\-sequence\fP
.br
.RE
.ll
.sp
The \fBname\fP is a logical name of color sequence (for example "error"). The names are specific to the utilities. For more details always see the \fBCOLORS\fP section in the man page for the utility.
.sp
The \fBcolor\-sequence\fP is a color name, ASCII color sequences or escape sequences.
.SS "Color names"
.sp
black, blink, blue, bold, brown, cyan, darkgray, gray, green, halfbright, lightblue, lightcyan, lightgray, lightgreen, lightmagenta, lightred, magenta, red, reset, reverse, and yellow.
.SS "ANSI color sequences"
.sp
The color sequences are composed of sequences of numbers separated by semicolons. The most common codes are:
.RS 3
.ll -.6i
.TS
allbox tab(:);
lt lt.
T{
.sp
0
T}:T{
.sp
to restore default color
T}
T{
.sp
1
T}:T{
.sp
for brighter colors
T}
T{
.sp
4
T}:T{
.sp
for underlined text
T}
T{
.sp
5
T}:T{
.sp
for flashing text
T}
T{
.sp
30
T}:T{
.sp
for black foreground
T}
T{
.sp
31
T}:T{
.sp
for red foreground
T}
T{
.sp
32
T}:T{
.sp
for green foreground
T}
T{
.sp
33
T}:T{
.sp
for yellow (or brown) foreground
T}
T{
.sp
34
T}:T{
.sp
for blue foreground
T}
T{
.sp
35
T}:T{
.sp
for purple foreground
T}
T{
.sp
36
T}:T{
.sp
for cyan foreground
T}
T{
.sp
37
T}:T{
.sp
for white (or gray) foreground
T}
T{
.sp
40
T}:T{
.sp
for black background
T}
T{
.sp
41
T}:T{
.sp
for red background
T}
T{
.sp
42
T}:T{
.sp
for green background
T}
T{
.sp
43
T}:T{
.sp
for yellow (or brown) background
T}
T{
.sp
44
T}:T{
.sp
for blue background
T}
T{
.sp
45
T}:T{
.sp
for purple background
T}
T{
.sp
46
T}:T{
.sp
for cyan background
T}
T{
.sp
47
T}:T{
.sp
for white (or gray) background
T}
.TE
.sp
.br
.RE
.ll
.SS "Escape sequences"
.sp
To specify control or blank characters in the color sequences, C\-style \(rs\-escaped notation can be used:
.RS 3
.ll -.6i
.TS
allbox tab(:);
lt lt.
T{
.sp
\fB\(rsa\fP
T}:T{
.sp
Bell (ASCII 7)
T}
T{
.sp
\fB\(rsb\fP
T}:T{
.sp
Backspace (ASCII 8)
T}
T{
.sp
\fB\(rse\fP
T}:T{
.sp
Escape (ASCII 27)
T}
T{
.sp
\fB\(rsf\fP
T}:T{
.sp
Form feed (ASCII 12)
T}
T{
.sp
\fB\(rsn\fP
T}:T{
.sp
Newline (ASCII 10)
T}
T{
.sp
\fB\(rsr\fP
T}:T{
.sp
Carriage Return (ASCII 13)
T}
T{
.sp
\fB\(rst\fP
T}:T{
.sp
Tab (ASCII 9)
T}
T{
.sp
\fB\(rsv\fP
T}:T{
.sp
Vertical Tab (ASCII 11)
T}
T{
.sp
\fB\(rs?\fP
T}:T{
.sp
Delete (ASCII 127)
T}
T{
.sp
\fB\(rs_\fP
T}:T{
.sp
Space
T}
T{
.sp
\fB\(rs\(rs\fP
T}:T{
.sp
Backslash (\(rs)
T}
T{
.sp
\fB\(rs^\fP
T}:T{
.sp
Caret (^)
T}
T{
.sp
\fB\(rs#\fP
T}:T{
.sp
Hash mark (#)
T}
.TE
.sp
.br
.RE
.ll
.sp
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.
.sp
For example, to use a red background for alert messages in the output of \fBdmesg\fP(1), use:
.RS 3
.ll -.6i
.sp
\fBecho \(aqalert 37;41\(aq >> /etc/terminal\-colors.d/dmesg.scheme\fP
.br
.RE
.ll
.SS "Comments"
.sp
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.
.SH "ENVIRONMENT"
.sp
\fBTERMINAL_COLORS_DEBUG\fP=all
.RS 4
enables debug output.
.RE
.SH "FILES"
.sp
\fI$XDG_CONFIG_HOME/terminal\-colors.d\fP
.sp
\fI$HOME/.config/terminal\-colors.d\fP
.sp
\fI/etc/terminal\-colors.d\fP
.SH "EXAMPLE"
.sp
Disable colors for all compatible utilities:
.RS 3
.ll -.6i
.sp
\fBtouch /etc/terminal\-colors.d/disable\fP
.br
.RE
.ll
.sp
Disable colors for all compatible utils on a vt100 terminal:
.RS 3
.ll -.6i
.sp
\fBtouch /etc/terminal\-colors.d/@vt100.disable\fP
.br
.RE
.ll
.sp
Disable colors for all compatible utils except \fBdmesg\fP(1):
.RS 3
.ll -.6i
.sp
\fBtouch /etc/terminal\-colors.d/disable\fP
.sp
\fBtouch /etc/terminal\-colors.d/dmesg.enable\fP
.br
.RE
.ll
.SH "COMPATIBILITY"
.sp
The \fBterminal\-colors.d\fP functionality is currently supported by all util\-linux utilities which provides colorized output. For more details always see the \fBCOLORS\fP section in the man page for the utility.
.SH "REPORTING BUGS"
.sp
For bug reports, use the issue tracker at \c
.URL "https://github.com/util\-linux/util\-linux/issues" "" "."
.SH "AVAILABILITY"
.sp
\fBterminal\-colors.d\fP is part of the util\-linux package which can be downloaded from \c
.URL "https://www.kernel.org/pub/linux/utils/util\-linux/" "Linux Kernel Archive" "."
|