]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
terminal-util: use colon as separator for specifying color
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 24 Jun 2024 08:55:17 +0000 (17:55 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 24 Jun 2024 08:57:07 +0000 (17:57 +0900)
Then, terminal will safely ignore unsupported features, like colored
underline.

Fixes a regression caused by 891abc9cf1d3d7afd7b740b4077551dcfb5f8e16.
Fixes https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1074073.
Fixes #33449.

src/basic/terminal-util.h

index 0c1c6373bc445a77d942d8c5025b7a934ec4ddbe..bdc46618c8f77ded689bf79d578021f52a3ccd13 100644 (file)
 #define ANSI_HIGHLIGHT_MAGENTA  "\x1B[0;1;35m"
 #define ANSI_HIGHLIGHT_CYAN     "\x1B[0;1;36m"
 #define ANSI_HIGHLIGHT_WHITE    "\x1B[0;1;37m"
-#define ANSI_HIGHLIGHT_YELLOW4  "\x1B[0;1;38;5;100m"
-#define ANSI_HIGHLIGHT_KHAKI3   "\x1B[0;1;38;5;185m"
-#define ANSI_HIGHLIGHT_GREY     "\x1B[0;1;38;5;245m"
+#define ANSI_HIGHLIGHT_YELLOW4  "\x1B[0;1;38:5:100m"
+#define ANSI_HIGHLIGHT_KHAKI3   "\x1B[0;1;38:5:185m"
+#define ANSI_HIGHLIGHT_GREY     "\x1B[0;1;38:5:245m"
 
 #define ANSI_HIGHLIGHT_YELLOW   ANSI_HIGHLIGHT_KHAKI3 /* Replacement yellow that is more legible */
 
 /* Underlined */
-#define ANSI_GREY_UNDERLINE              "\x1B[0;4;38;5;245m"
+#define ANSI_GREY_UNDERLINE              "\x1B[0;4;38:5:245m"
 #define ANSI_BRIGHT_BLACK_UNDERLINE      "\x1B[0;4;90m"
 #define ANSI_HIGHLIGHT_RED_UNDERLINE     "\x1B[0;1;4;31m"
 #define ANSI_HIGHLIGHT_GREEN_UNDERLINE   "\x1B[0;1;4;32m"
-#define ANSI_HIGHLIGHT_YELLOW_UNDERLINE  "\x1B[0;1;4;38;5;185m"
+#define ANSI_HIGHLIGHT_YELLOW_UNDERLINE  "\x1B[0;1;4;38:5:185m"
 #define ANSI_HIGHLIGHT_BLUE_UNDERLINE    "\x1B[0;1;4;34m"
 #define ANSI_HIGHLIGHT_MAGENTA_UNDERLINE "\x1B[0;1;4;35m"
-#define ANSI_HIGHLIGHT_GREY_UNDERLINE    "\x1B[0;1;4;38;5;245m"
+#define ANSI_HIGHLIGHT_GREY_UNDERLINE    "\x1B[0;1;4;38:5:245m"
 
 /* Other ANSI codes */
 #define ANSI_UNDERLINE "\x1B[0;4m"
 #define ANSI_ADD_UNDERLINE "\x1B[4m"
-#define ANSI_ADD_UNDERLINE_GREY ANSI_ADD_UNDERLINE "\x1B[58;5;245m"
+#define ANSI_ADD_UNDERLINE_GREY ANSI_ADD_UNDERLINE "\x1B[58:5:245m"
 #define ANSI_HIGHLIGHT "\x1B[0;1;39m"
 #define ANSI_HIGHLIGHT_UNDERLINE "\x1B[0;1;4m"