1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-31 14:50:15 +03:00

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.
This commit is contained in:
Lennart Poettering 2025-02-17 22:29:54 +01:00
parent 0e7dd5aa4d
commit 787904d078

View File

@ -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);