diff --git a/man/kernel-command-line.xml b/man/kernel-command-line.xml index 09f8ace4de..211ae5ac57 100644 --- a/man/kernel-command-line.xml +++ b/man/kernel-command-line.xml @@ -590,8 +590,10 @@ These arguments allow configuring default values for $TERM, TTYRows=, and TTYColumns= for tty - tty. The tty name should be specified without the - /dev/ prefix (e.g. systemd.tty.rows.ttyS0=80). + tty. Additionally, systemd.tty.term.console will + configure the $TERM value used by systemd if not set explicitly + using TERM on the kernel command line. The tty name should be specified without + the /dev/ prefix (e.g. systemd.tty.rows.ttyS0=80). diff --git a/src/core/main.c b/src/core/main.c index 5347372c81..86385d6465 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -1425,6 +1425,12 @@ static int fixup_environment(void) { if (r < 0) return r; + if (r == 0) { + r = proc_cmdline_get_key("systemd.tty.term.console", 0, &term); + if (r < 0) + return r; + } + t = term ?: default_term_for_tty("/dev/console"); if (setenv("TERM", t, 1) < 0)