ECH handled correctly.

master
Aurélien Aptel 2010-02-21 14:14:58 +01:00
parent eff05c7b90
commit 3ba517e796
1 changed files with 22 additions and 5 deletions

27
st.c
View File

@ -692,13 +692,24 @@ csihandle(void) {
default: default:
goto unknown; goto unknown;
} }
} else goto unknown; } else {
switch(escseq.arg[0]) {
case 4:
term.mode &= ~MODE_INSERT;
break;
default:
goto unknown;
}
}
break; break;
case 'M': /* DL -- Delete <n> lines */ case 'M': /* DL -- Delete <n> lines */
DEFAULT(escseq.arg[0], 1); DEFAULT(escseq.arg[0], 1);
tdeleteline(escseq.arg[0]); tdeleteline(escseq.arg[0]);
break; 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 */ case 'P': /* DCH -- Delete <n> char */
DEFAULT(escseq.arg[0], 1); DEFAULT(escseq.arg[0], 1);
tdeletechar(escseq.arg[0]); tdeletechar(escseq.arg[0]);
@ -727,10 +738,16 @@ csihandle(void) {
tcursor(CURSOR_SAVE); tcursor(CURSOR_SAVE);
tclearregion(0, 0, term.col-1, term.row-1); tclearregion(0, 0, term.col-1, term.row-1);
break; break;
default: default: goto unknown;
goto unknown;
} }
} else goto unknown; } else {
switch(escseq.arg[0]) {
case 4:
term.mode |= MODE_INSERT;
break;
default: goto unknown;
}
};
break; break;
case 'm': /* SGR -- Terminal attribute (color) */ case 'm': /* SGR -- Terminal attribute (color) */
tsetattr(escseq.arg, escseq.narg); tsetattr(escseq.arg, escseq.narg);