ldlinux: Clear screen on ASCII 12 (form feed) in DISPLAY file
authorMatt Fleming <matt.fleming@intel.com>
Thu, 24 Jan 2013 11:07:08 +0000 (11:07 +0000)
committerMatt Fleming <matt.fleming@intel.com>
Thu, 24 Jan 2013 11:09:27 +0000 (11:09 +0000)
The ansi code won't handle \f the way we want, so we need to
explicitly clear the screen and reset the cursor position, like the
old 4.x code.

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
com32/elflink/ldlinux/msg.c

index 2efcc79..4692716 100644 (file)
@@ -89,6 +89,11 @@ static inline void msg_ctrl_o(void)
        NextCharJump = msg_setbg;
 }
 
+static void msg_formfeed(void)
+{
+       printf("\033[2J\033[H");
+}
+
 static void msg_novga(void)
 {
        syslinux_force_text_mode();
@@ -191,6 +196,9 @@ static void msg_putchar(uint8_t ch)
                break;
        case 0x0D:              /* Ignore <CR> */
                break;
+       case 0x0C:              /* <FF> = clear screen */
+               msg_formfeed();
+               break;
        case 0x19:              /* <EM> = return to text mode */
                msg_novga();
                break;