diff options
author | Haoran S. Diao (刁浩然) <0@hairydiode.xyz> | 2025-09-12 22:33:39 -0700 |
---|---|---|
committer | Haoran S. Diao (刁浩然) <0@hairydiode.xyz> | 2025-09-12 22:33:39 -0700 |
commit | 9a6954f9720784bc79668bcc6456f6a3f6a0c5a1 (patch) | |
tree | c605b3dab85848841a779bc8b0f864d67464ab6f /escape.h | |
parent | 9f80defcd51d2c429de55e1209dfa8f6fd22bc69 (diff) |
Made it so pressing escape twice sends an escape to the IM, fixed the status
line persisting even on exit. Refactored main process exit
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; |