diff options
Diffstat (limited to 'escape.h')
-rw-r--r-- | escape.h | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -31,6 +31,8 @@ enum esc_state { DECSC, DECRC, NORMAL, + //escape followed by an escape, has to be user generated + DOUBLE_ESC, }; //global stdin -> pty ESC state enum esc_state in_state = NORMAL; @@ -54,6 +56,7 @@ enum esc_state update_esc_state(char * buff,unsigned int buff_len, enum esc_stat case C1: case DECSC: case DECRC: + case DOUBLE_ESC: //all the sequences that have ended don't have an end //and default to normal case NORMAL: @@ -91,8 +94,12 @@ enum esc_state update_esc_state(char * buff,unsigned int buff_len, enum esc_stat } else if (c == '8') { state = DECSC; + } + else if (c == 0x1B) { + state = DOUBLE_ESC; //deformed escape sequence - } else { + } + else { state = NORMAL; } break; |