aboutsummaryrefslogtreecommitdiff
path: root/st.c
diff options
context:
space:
mode:
authorAurélien Aptel <aurelien.aptel@gmail.com>2010-02-21 14:14:58 +0100
committerAurélien Aptel <aurelien.aptel@gmail.com>2010-02-21 14:14:58 +0100
commit8d12cb403526368aa7e4df3769c93c62a9e7354a (patch)
tree19b85958741f4bceb61e83b7a8c50b6fca60e2f2 /st.c
parentbc4b43be4406b14b59e9e41afa132d82f1a1aaf7 (diff)
downloadst-8d12cb403526368aa7e4df3769c93c62a9e7354a.tar.gz
st-8d12cb403526368aa7e4df3769c93c62a9e7354a.tar.bz2
ECH handled correctly.
Diffstat (limited to 'st.c')
-rw-r--r--st.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/st.c b/st.c
index fcb3d65..15ff4f8 100644
--- a/st.c
+++ b/st.c
@@ -692,13 +692,24 @@ csihandle(void) {
default:
goto unknown;
}
- } else goto unknown;
+ } else {
+ switch(escseq.arg[0]) {
+ case 4:
+ term.mode &= ~MODE_INSERT;
+ break;
+ default:
+ goto unknown;
+ }
+ }
break;
case 'M': /* DL -- Delete <n> lines */
DEFAULT(escseq.arg[0], 1);
tdeleteline(escseq.arg[0]);
break;
- case 'X': /* ECH -- Erase <n> char XXX: same? */
+ case 'X': /* ECH -- Erase <n> char */
+ DEFAULT(escseq.arg[0], 1);
+ tclearregion(term.c.x, term.c.y, term.c.x + escseq.arg[0], term.c.y);
+ break;
case 'P': /* DCH -- Delete <n> char */
DEFAULT(escseq.arg[0], 1);
tdeletechar(escseq.arg[0]);
@@ -727,10 +738,16 @@ csihandle(void) {
tcursor(CURSOR_SAVE);
tclearregion(0, 0, term.col-1, term.row-1);
break;
- default:
- goto unknown;
+ default: goto unknown;
+ }
+ } else {
+ switch(escseq.arg[0]) {
+ case 4:
+ term.mode |= MODE_INSERT;
+ break;
+ default: goto unknown;
}
- } else goto unknown;
+ };
break;
case 'm': /* SGR -- Terminal attribute (color) */
tsetattr(escseq.arg, escseq.narg);