summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/util.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/util.c b/src/util.c
index d0c903993c..80b88b0e4e 100644
--- a/src/util.c
+++ b/src/util.c
@@ -3573,7 +3573,13 @@ const char *default_term_for_tty(const char *tty) {
if (streq(tty, "console"))
if (read_one_line_file("/sys/class/tty/console/active", &active) >= 0) {
truncate_nl(active);
- tty = active;
+
+ /* If multiple log outputs are configured the
+ * last one is what /dev/console points to */
+ if ((tty = strrchr(active, ' ')))
+ tty++;
+ else
+ tty = active;
}
term = tty_is_vc(tty) ? "TERM=linux" : "TERM=vt100";