Skip to content

Commit 5fee4ac

Browse files
committed
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.
1 parent d5b6c6e commit 5fee4ac

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/firstboot/firstboot.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ static void print_welcome(int rfd) {
131131
pn = os_release_pretty_name(pretty_name, os_name);
132132
ac = isempty(ansi_color) ? "0" : ansi_color;
133133

134+
(void) reset_terminal_fd(STDIN_FILENO, /* switch_to_text= */ false);
135+
134136
if (colors_enabled())
135137
printf("\nWelcome to your new installation of \x1B[%sm%s\x1B[0m!\n", ac, pn);
136138
else

0 commit comments

Comments
 (0)