diff options
-rw-r--r-- | man/kernel-command-line.xml | 6 | ||||
-rw-r--r-- | src/core/main.c | 6 |
2 files changed, 10 insertions, 2 deletions
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 @@ <listitem><para>These arguments allow configuring default values for <varname>$TERM</varname>, <varname>TTYRows=</varname>, and <varname>TTYColumns=</varname> for tty - <replaceable>tty</replaceable>. The tty name should be specified without the - <filename>/dev/</filename> prefix (e.g. <literal>systemd.tty.rows.ttyS0=80</literal>). + <replaceable>tty</replaceable>. Additionally, <varname>systemd.tty.term.console</varname> will + configure the <varname>$TERM</varname> value used by <command>systemd</command> if not set explicitly + using <varname>TERM</varname> on the kernel command line. The tty name should be specified without + the <filename>/dev/</filename> prefix (e.g. <literal>systemd.tty.rows.ttyS0=80</literal>). </para></listitem> </varlistentry> </variablelist> 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) |