commit - 8ebab415921d534461b0fb8bce8fa1442afaba42
commit + 6cd5c3dab7e47553bc14a8a7cf76708f708b508e
blob - 89d123c18650c4c2aae2234405f404eb98f872d0
blob + 3b7eb787029f2ce691771a86b1caa40f45ebbd1e
--- st.c
+++ st.c
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