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>
Wed, 5 Jul 2017 06:50:51 +0000 (08:50 +0200)
commit0801458c689ba85fd27666f69e42818f87353bc2
treee1c08361a788ed4fc5325f06dc4bbed07a5016d0
parent92842665f9dc63bc7f1671bed792a8e58014f952
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.
src/basic/terminal-util.c