pinosaur
/
st.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
53ac69e
)
rewrite csidump().
author
Aurélien Aptel
<aurelien.aptel@gmail.com>
Wed, 15 Feb 2012 23:58:16 +0000
(
00:58
+0100)
committer
Aurélien Aptel
<aurelien.aptel@gmail.com>
Wed, 15 Feb 2012 23:58:16 +0000
(
00:58
+0100)
st.c
patch
|
blob
|
history
diff --git
a/st.c
b/st.c
index
89d123c
..
3b7eb78
100644
(file)
--- a/
st.c
+++ b/
st.c
@@
-1387,8
+1387,17
@@
csihandle(void) {
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