]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[console] Allow '?' as an intermediate byte in ANSI escape sequences
authorMichael Brown <mcb30@ipxe.org>
Mon, 2 Dec 2013 17:20:36 +0000 (17:20 +0000)
committerMichael Brown <mcb30@ipxe.org>
Mon, 2 Dec 2013 17:20:36 +0000 (17:20 +0000)
The ANSI escape sequences to show and hide the cursor take the form
"<ESC>[?25h" and "<ESC>[?25l" respectively.  iPXE currently treats the
'?' character as the final byte.  Fix by explicitly treating '?' as an
intermediate byte.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/core/ansiesc.c
src/include/ipxe/ansiesc.h

index 68e7061b323479d951f0e4defd3cefa789f39b89..ca9a73ce0e369ad5bb0de31865d47f0aa6204a21 100644 (file)
@@ -99,7 +99,8 @@ int ansiesc_process ( struct ansiesc_context *ctx, int c ) {
                                DBG ( "Too many parameters in ANSI escape "
                                      "sequence\n" );
                        }
-               } else if ( ( c >= 0x20 ) && ( c <= 0x2f ) ) {
+               } else if ( ( ( c >= 0x20 ) && ( c <= 0x2f ) ) ||
+                           ( c == '?' ) ) {
                        /* Intermediate Byte */
                        ctx->function <<= 8;
                        ctx->function |= c;
index e84545769b1e0e53357f6d00131cdfe7a9bcfd76..c1c74481df2f2f951733d5a7b0a11a0126ecee15 100644 (file)
@@ -124,6 +124,12 @@ struct ansiesc_context {
  */
 #define ANSIESC_LOG_PRIORITY 'p'
 
+/** Show cursor */
+#define ANSIESC_DECTCEM_SET ( ( '?' << 8 ) | 'h' )
+
+/** Hide cursor */
+#define ANSIESC_DECTCEM_RESET ( ( '?' << 8 ) | 'l' )
+
 /** @} */
 
 extern int ansiesc_process ( struct ansiesc_context *ctx, int c );