From bb40c12569d017f75774ff9f4b6fb0ac64f9eee0 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 10 May 2019 14:52:05 -0400 Subject: [PATCH] terminal-util: define grey as 256color ANSI sequence Apparently all relevant terminals implement these sequences, including the Linux kernel, rxvt, xterm, and of course gnome terminal. Hence it should be OK to use them, and fixate the grey color in a way that maps to the same color in all terminals. Ideally we'd stick to the more symbolic colors that allow terminal emulators to implement color styles, but this apparently doesn#t work, since rxvt maps grey to something unreadable by default. Note that this change has negative effects besides the non-themability of the palette: the midrange grey this uses maps to regular white on the linux console. However, that's probably not too bad: allowing things to be unreadable on some terminals is probably worse than showing no color on some terminals. Fixes: #12482 --- src/basic/terminal-util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/basic/terminal-util.h b/src/basic/terminal-util.h index f3e785e7ba3..6a77e5ebb9b 100644 --- a/src/basic/terminal-util.h +++ b/src/basic/terminal-util.h @@ -19,7 +19,7 @@ #define ANSI_MAGENTA "\x1B[0;35m" #define ANSI_CYAN "\x1B[0;36m" #define ANSI_WHITE "\x1B[0;37m" -#define ANSI_GREY "\x1B[0;2;37m" +#define ANSI_GREY "\x1B[0;38;5;245m" /* Bold/highlighted */ #define ANSI_HIGHLIGHT_BLACK "\x1B[0;1;30m" -- 2.39.2