Browse Source

[console] Allow '?' as an intermediate byte in ANSI escape sequences

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>
tags/v1.20.1
Michael Brown 11 years ago
parent
commit
135bf35b11
2 changed files with 8 additions and 1 deletions
  1. 2
    1
      src/core/ansiesc.c
  2. 6
    0
      src/include/ipxe/ansiesc.h

+ 2
- 1
src/core/ansiesc.c View File

99
 				DBG ( "Too many parameters in ANSI escape "
99
 				DBG ( "Too many parameters in ANSI escape "
100
 				      "sequence\n" );
100
 				      "sequence\n" );
101
 			}
101
 			}
102
-		} else if ( ( c >= 0x20 ) && ( c <= 0x2f ) ) {
102
+		} else if ( ( ( c >= 0x20 ) && ( c <= 0x2f ) ) ||
103
+			    ( c == '?' ) ) {
103
 			/* Intermediate Byte */
104
 			/* Intermediate Byte */
104
 			ctx->function <<= 8;
105
 			ctx->function <<= 8;
105
 			ctx->function |= c;
106
 			ctx->function |= c;

+ 6
- 0
src/include/ipxe/ansiesc.h View File

124
  */
124
  */
125
 #define ANSIESC_LOG_PRIORITY 'p'
125
 #define ANSIESC_LOG_PRIORITY 'p'
126
 
126
 
127
+/** Show cursor */
128
+#define ANSIESC_DECTCEM_SET ( ( '?' << 8 ) | 'h' )
129
+
130
+/** Hide cursor */
131
+#define ANSIESC_DECTCEM_RESET ( ( '?' << 8 ) | 'l' )
132
+
127
 /** @} */
133
 /** @} */
128
 
134
 
129
 extern int ansiesc_process ( struct ansiesc_context *ctx, int c );
135
 extern int ansiesc_process ( struct ansiesc_context *ctx, int c );

Loading…
Cancel
Save