From: Lennart Poettering Date: Mon, 17 Feb 2025 21:29:54 +0000 (+0100) Subject: terminal-util: output newline at end of "Press any key to proceed" message X-Git-Tag: v258-rc1~1316^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F36424%2Fhead;p=thirdparty%2Fsystemd.git terminal-util: output newline at end of "Press any key to proceed" message So far we'd leave the cursor at the end of the Press any key to proceed message as long as the user didn't type in anything yet, and generated the newline only after. Let's switch this around: let's output the newline before. This should make boot-time output nicer since it means concurrent output while we wait will start at the beginning of line, and not in the middle. --- diff --git a/src/basic/terminal-util.c b/src/basic/terminal-util.c index f9e2a280246..0a185776303 100644 --- a/src/basic/terminal-util.c +++ b/src/basic/terminal-util.c @@ -485,12 +485,12 @@ bool any_key_to_proceed(void) { fputs(ansi_highlight_magenta(), stdout); fputs("-- Press any key to proceed --", stdout); fputs(ansi_normal(), stdout); + fputc('\n', stdout); fflush(stdout); char key = 0; (void) read_one_char(stdin, &key, USEC_INFINITY, /* echo= */ false, /* need_nl= */ NULL); - fputc('\n', stdout); fputc('\n', stdout); fflush(stdout);