From: Zbigniew Jędrzejewski-Szmek Date: Wed, 20 Apr 2016 01:56:39 +0000 (-0400) Subject: pid1: disable color output when TERM=dumb X-Git-Tag: v230~162^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d5ca5e132463c52c5a9c6285475c7a51b894b9e4;p=thirdparty%2Fsystemd.git pid1: disable color output when TERM=dumb 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. --- diff --git a/src/core/main.c b/src/core/main.c index 29126084357..8dfb3928dec 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -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 */