From: Lennart Poettering Date: Wed, 22 Nov 2023 12:13:03 +0000 (+0100) Subject: firstboot: reset terminal settings right before asking a question X-Git-Tag: v255-rc3~6^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F30145%2Fhead;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c index 6cf7415a188..f77a5f62665 100644 --- a/src/firstboot/firstboot.c +++ b/src/firstboot/firstboot.c @@ -131,6 +131,8 @@ static void print_welcome(int rfd) { 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