From a0ea3f94018b0f091b75f689716c0ec358c9e019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Haoran=20S=2E=20Diao=20=28=E5=88=81=E6=B5=A9=E7=84=B6=29?= <0@hairydiode.xyz> Date: Sat, 13 Sep 2025 03:10:43 -0700 Subject: 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 --- escape.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/escape.h b/escape.h index 20ec740..d04415d 100644 --- a/escape.h +++ b/escape.h @@ -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; -- cgit v1.1