From d5ca5e132463c52c5a9c6285475c7a51b894b9e4 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Tue, 19 Apr 2016 21:56:39 -0400 Subject: 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. --- src/core/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/main.c b/src/core/main.c index 2912608435..8dfb3928de 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 */ -- cgit v1.2.3-54-g00ecf