summaryrefslogtreecommitdiffstats
path: root/src/basic/terminal-util.c
diff options
context:
space:
mode:
authorSonali Srivastava <srivastava.sonali1@gmail.com>2022-04-20 21:28:02 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-05-05 09:18:51 +0200
commita5efbf468c96190c9562bc8121eda32310dfd112 (patch)
tree3ca27744273d2550e3d941a3eec3108f856aab5b /src/basic/terminal-util.c
parentMerge pull request #23246 from medhefgo/check-compilation (diff)
downloadsystemd-a5efbf468c96190c9562bc8121eda32310dfd112.tar.xz
systemd-a5efbf468c96190c9562bc8121eda32310dfd112.zip
terminal-util: get_color_mode checks COLORTERM
Diffstat (limited to 'src/basic/terminal-util.c')
-rw-r--r--src/basic/terminal-util.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/basic/terminal-util.c b/src/basic/terminal-util.c
index 7cf74e97d0..8ddcfe2323 100644
--- a/src/basic/terminal-util.c
+++ b/src/basic/terminal-util.c
@@ -1278,6 +1278,11 @@ ColorMode get_color_mode(void) {
/* We only check for the presence of the variable; value is ignored. */
cached_color_mode = COLOR_OFF;
+ else if (STRPTR_IN_SET(getenv("COLORTERM"),
+ "truecolor",
+ "24bit"))
+ cached_color_mode = COLOR_24BIT;
+
else if (getpid_cached() == 1)
/* PID1 outputs to the console without holding it open all the time.
*