systemd: ignore lack of tty when checking whether colors should be enabled
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 19 Aug 2016 02:03:56 +0000 (22:03 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 19 Aug 2016 15:34:22 +0000 (11:34 -0400)
commit158fbf7661912adf0f42c93155499119811dde82
treeb2c3167b2fb6ec6f665d9c55abc9df385e31ef86
parentbd64d82c1c0e3fe2a5f9b3dd9132d62834f50b2d
systemd: ignore lack of tty when checking whether colors should be enabled

When started by the kernel, we are connected to the console, and we'll set TERM
properly to some value in fixup_environment(). We'll then enable or disable
colors based on the value of $SYSTEMD_COLORS and $TERM.

When reexecuting, TERM should be already set, so we can use this value.
Effectively, behaviour is the same as before affd7ed1a was reverted, but instead
of reopening the console before configuring color output, we just ignore what
stdout is connected to and decide based on the variables only.
src/basic/terminal-util.c