table of contents
| TERMINAL-COLORS.D(5) | Formaty plików | TERMINAL-COLORS.D(5) |
NAZWA¶
terminal-colors.d - konfiguruje kolorowanie wyjścia różnych narzędzi
SKŁADNIA¶
/etc/terminal-colors.d/[[nazwa][@terminal].][typ]
OPIS¶
Pliki w tym katalogu określają domyślne zachowanie narzędzie, przy kolorowaniu ich wyjścia.
Nazwa jest nazwą narzędzia. Nazwa jest opcjonalna, a gdy się jej nie poda, plik jest używany dla wszystkich nieokreślonych gdzie indziej narzędzi.
Termimal jest identyfikatorem terminala (zmienna środowiskowa TERM). Identyfikator terminala jest opcjonalny, a gdy się go nie poda, plik jest używany dla wszystkich nieokreślonych gdzie indziej terminali.
Typ jest typem pliku. Obsługiwane są następujące typy plików:
disable
enable
scheme
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").
Globalne ustawienie przesłonią $XDG_CONFIG_HOME/terminal-colors.d lub $HOME/.config/terminal-colors.d danego użytkownika.
DOMYŚLNY FORMAT PLIKÓW SCHEME¶
Rozpoznawane jest następujące wyrażenie:
name color-sequence
The name is a logical name for the 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.
Nazwy kolorów¶
black, blink, blue, bold, brown, cyan, darkgray, gray, green, halfbright, lightblue, lightcyan, lightgray, lightgreen, lightmagenta, lightred, magenta, red, reset, reverse i yellow.
Sekwencje kolorów ANSI¶
Sekwencje kolorów składająsię z sekwencji liczb rozdzielonych dwukropkami. Najpopularniejsze kody to:
| 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 |
Na przykład, aby użyć czerwonego tła dla komunikatów typu alert w programie dmesg(1), można wykonać:
echo 'alert 37;41' >> /etc/terminal-colors.d/dmesg.scheme
Sekwencje specjalne¶
An escape sequence is necessary to enter a space, backslash, caret, or any control character anywhere in a string, as well as a hash mark as the first character. These C-style backslash-escapes can be used:
| \a | Bell (ASCII 7) |
| \b | Backspace (ASCII 8) |
| \e | Escape (ASCII 27) |
| \f | Form feed (ASCII 12) |
| \n | Newline (ASCII 10) |
| \r | Carriage Return (ASCII 13) |
| \t | Tab (ASCII 9) |
| \v | Vertical Tab (ASCII 11) |
| \? | Delete (ASCII 127) |
| \_ | Space |
| \\ | Backslash (\) |
| \^ | Caret (^) |
| \\# | Hash mark (#) |
Komentarze¶
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.
ŚRODOWISKO¶
TERMINAL_COLORS_DEBUG=all
NO_COLOR
PLIKI¶
$XDG_CONFIG_HOME/terminal-colors.d
$HOME/.config/terminal-colors.d
/etc/terminal-colors.d
PRZYKŁAD¶
Wyłącza kolory dla wszystkich kompatybilnych narzędzi:
touch /etc/terminal-colors.d/disable
Wyłącza kolory dla wszystkich kompatybilnych narzędzi na terminalu vt100:
touch /etc/terminal-colors.d/@vt100.disable
Wyłącza kolory dla wszystkich kompatybilnych narzędzi poza dmesg(1):
touch /etc/terminal-colors.d/disable
touch /etc/terminal-colors.d/dmesg.enable
ZGODNOŚĆ¶
Funkcje terminal-colors.d są obecnie obsługiwane przez wszystkie narzędzia util-linux zapewniające koloryzowanie wyniku. Więcej szczegółów zawiera zawsze rozdział KOLORY podręcznika systemowego danego narzędzia.
ZGŁASZANIE BŁĘDÓW¶
Problemy należy zgłaszać w systemie śledzenia błędów <https://github.com/util-linux/util-linux/issues>.
DOSTĘPNOŚĆ¶
Plik konfiguracyjny terminal-colors.d jest częścią pakietu util-linux, który można pobrać ze strony Archiwum jądra Linux <https://www.kernel.org/pub/linux/utils/util-linux/>.
| 2026-04-19 | util-linux 2.42 |