diff options
author | Sonali Srivastava <srivastava.sonali1@gmail.com> | 2022-04-20 21:28:02 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-05-05 09:18:51 +0200 |
commit | a5efbf468c96190c9562bc8121eda32310dfd112 (patch) | |
tree | 3ca27744273d2550e3d941a3eec3108f856aab5b /src/basic/terminal-util.c | |
parent | Merge pull request #23246 from medhefgo/check-compilation (diff) | |
download | systemd-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.c | 5 |
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. * |