chiark / gitweb /
elogind: 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)
committerSven Eden <yamakuzure@gmx.net>
Mon, 19 Jun 2017 07:40:51 +0000 (09:40 +0200)
commitb1591e0aad5d4f66c6925e050299569b5ceb6d1d
tree6c60ed12559770cbb3f3812edee9621cea74afd8
parente7db23c373b2b44cb38db54f815e7ba02086554b
elogind: 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.

(cherry picked from commit 158fbf7661912adf0f42c93155499119811dde82)
src/basic/terminal-util.c