mirror of
https://github.com/ipxe/ipxe
synced 2026-05-08 15:02:55 +03:00
[console] Flush line-based console after each progress update
Download progress messages will not currently appear via the syslog console (or any other line buffering console) until the download completes and the newline character is printed. Use the ASCII unit separator (US) character to indicate the end of each per-second progress message, and modify the line console to react to this character by sending out the incomplete line. Suggested-by: Christian I. Nilsson <nikize@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -60,6 +60,12 @@ size_t line_putchar ( struct line_console *line, int character ) {
|
||||
if ( character == CR )
|
||||
return 0;
|
||||
|
||||
/* Handle unit separator (to print without resetting) */
|
||||
if ( character == US ) {
|
||||
line->buffer[line->index] = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Treat newline as a terminator */
|
||||
if ( character == LF )
|
||||
character = 0;
|
||||
|
||||
@@ -156,6 +156,7 @@ int monojob_wait ( const char *string, unsigned long timeout ) {
|
||||
clear_len += printf ( " [%s]",
|
||||
progress.message );
|
||||
}
|
||||
putchar ( US );
|
||||
last_display = now;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ FILE_SECBOOT ( PERMITTED );
|
||||
#define LF CTRL_J
|
||||
#define CR CTRL_M
|
||||
#define ESC 0x1b
|
||||
#define US 0x1f
|
||||
#define DEL 0x7f
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user