Clear current line before printing \nPlease press Enter ...
@@ -286,6 +286,7 @@ static int activate_console(int noclear, int nowait)
while (!fexist(SYNC_SHUTDOWN)) {
char c;
+ static const char clr[] = "\r\e[2K";
static const char msg[] = "\nPlease press Enter to activate this console.";
if (fexist(SYNC_STOPPED)) {
@@ -293,6 +294,7 @@ static int activate_console(int noclear, int nowait)
continue;
}
+ (void)write(STDERR_FILENO, clr, sizeof(clr));
(void)write(STDERR_FILENO, msg, sizeof(msg));
while (read(STDIN_FILENO, &c, 1) == 1 && c != '\n')
continue;
@@ -300,6 +302,7 @@ static int activate_console(int noclear, int nowait)
if (fexist(SYNC_STOPPED))
continue;
+ (void)write(STDERR_FILENO, clr, sizeof(clr));
ret = 1;
break;
}
