]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
pid1: disable color output when TERM=dumb
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 20 Apr 2016 01:56:39 +0000 (21:56 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 20 Apr 2016 13:00:39 +0000 (09:00 -0400)
This changes the behaviour of pid1 in the following ways:
- obviously $TERM is now checked,
- $SYSTEMD_COLORS is now honoured too, before only SYSTEMD_LOG_COLORS was checked,
- isatty() is run on stdout not stderr.

As requested in #3025.

src/core/main.c

index 2912608435732beae6c3abc031ddebe7a5af3223..8dfb3928decd7b241019ac5a64e86ab8b392a529 100644 (file)
@@ -1338,7 +1338,7 @@ int main(int argc, char *argv[]) {
         saved_argv = argv;
         saved_argc = argc;
 
-        log_show_color(isatty(STDERR_FILENO) > 0);
+        log_show_color(colors_enabled());
         log_set_upgrade_syslog_to_journal(true);
 
         /* Disable the umask logic */