1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-13 12:58:20 +03:00

firstboot: reset terminal settings right before asking a question

We are about to do interactivity on the terminal, hence let's ensure we
are in the TTY mode we expect to be in.

(cherry picked from commit 5fee4ac0f4b2d339300cc692d09e3b904c25b887)
(cherry picked from commit b36e50821a09b4965aee675881380d7289646d96)
This commit is contained in:
Lennart Poettering 2023-11-22 13:13:03 +01:00 committed by Zbigniew Jędrzejewski-Szmek
parent c76d149b37
commit 982c5f959e

View File

@ -121,6 +121,8 @@ static void print_welcome(void) {
pn = os_release_pretty_name(pretty_name, os_name);
ac = isempty(ansi_color) ? "0" : ansi_color;
(void) reset_terminal_fd(STDIN_FILENO, /* switch_to_text= */ false);
if (colors_enabled())
printf("\nWelcome to your new installation of \x1B[%sm%s\x1B[0m!\n", ac, pn);
else