Sfoglia il codice sorgente

[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 10 anni fa
parent
commit
135bf35b11
2 ha cambiato i file con 8 aggiunte e 1 eliminazioni
  1. 2
    1
      src/core/ansiesc.c
  2. 6
    0
      src/include/ipxe/ansiesc.h

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

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

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

@@ -124,6 +124,12 @@ struct ansiesc_context {
124 124
  */
125 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 135
 extern int ansiesc_process ( struct ansiesc_context *ctx, int c );

Loading…
Annulla
Salva