From: Aurélien Aptel Date: Sun, 21 Feb 2010 13:14:58 +0000 (+0100) Subject: ECH handled correctly. X-Git-Url: https://git.danieliu.xyz/?a=commitdiff_plain;h=3ba517e796e0c7a73c5030ad791be1db36a8cec5;p=st.git ECH handled correctly. --- 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 lines */ DEFAULT(escseq.arg[0], 1); tdeleteline(escseq.arg[0]); break; - case 'X': /* ECH -- Erase char XXX: same? */ + case 'X': /* ECH -- Erase 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 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);