diff options
author | Haoran S. Diao (刁浩然) <0@hairydiode.xyz> | 2025-09-13 03:10:43 -0700 |
---|---|---|
committer | Haoran S. Diao (刁浩然) <0@hairydiode.xyz> | 2025-09-13 03:10:43 -0700 |
commit | a0ea3f94018b0f091b75f689716c0ec358c9e019 (patch) | |
tree | 4a8bd128fc00b20a984fdb7432b6eda80e0ae42c | |
parent | 619d74d6ad638de0dceb9d5d3cc1a6b3f0ed3963 (diff) |
Added ECMA-48 mode switches to the list of clr commands because obscure private
use ones like \033[?1049h found in no documentation anywhere can clear the
screen
-rw-r--r-- | escape.h | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -17,6 +17,9 @@ //ESC c //ESC [ [1-3] J +//ESCMA-49 mode switch bullshit that may or may not clear the screen +// ESC [ ? [0-9]* [lh] + //ESC [ [1-2] K //ESC [ m @ // note: these two can't clear im preview b/c of scroll locking @@ -78,6 +81,8 @@ int out_clr = 0; //updates c parity depending on cursor store and restore //if c parity is not NULL + // only from ESC 7 and ESC 8, any terminal that implements the CSI + // ESC [ s and ESC [ u probably doesn't use the same buffer as above //sets clr to 1 if it encounters a cursor clear escape sequence // if clr is not NULL @@ -171,7 +176,7 @@ enum esc_state update_esc_state(char * buff,unsigned int buff_len, break; case CSI_START: case CSI_MID: - if (c == 'J') { + if (c == 'J' || c == 'h' || c == 'l') { state = CSI_END; if (clr != NULL) { *clr = 1; |