all repos — st @ cb2e0e9c31a510cd6cdbbd3b0da231157a975d95

st (suckless terminal) config

rewrite csidump().
Aurélien Aptel aurelien.aptel@gmail.com
commit

cb2e0e9c31a510cd6cdbbd3b0da231157a975d95

parent

53ac69e90d95e52dedf99129e39a993d45c812ea

1 files changed, 11 insertions(+), 2 deletions(-)

jump to
M st.cst.c

@@ -1387,8 +1387,17 @@ }

void csidump(void) { - fwrite("\033[", 1, 2, stdout); - fwrite(escseq.buf, 1, escseq.len, stdout); + int i; + fwrite("ESC[", 1, 4, stdout); + for(i = 0; i < escseq.len; i++) { + uint c = escseq.buf[i] & 0xff; + if(isprint(c)) putchar(c); + else if(c == '\n') printf("(\\n)"); + else if(c == '\r') printf("(\\r)"); + else if(c == 0x1b) printf("(\\e)"); + else printf("(%02x)", c); + } + putchar('\n'); } void