rewrite csidump().

master
Aurélien Aptel 13 years ago
parent 53ac69e90d
commit cb2e0e9c31

13
st.c

@ -1387,8 +1387,17 @@ csihandle(void) {
void void
csidump(void) { csidump(void) {
fwrite("\033[", 1, 2, stdout); int i;
fwrite(escseq.buf, 1, escseq.len, stdout); 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 void

Loading…
Cancel
Save