Implement ECH (erase character, CSI X). Reported by Christian Neukirchen.

This commit is contained in:
Nicholas Marriott
2013-01-15 23:18:55 +00:00
parent bc2e4a36df
commit 44f8e1caff
5 changed files with 50 additions and 0 deletions

17
tty.c
View File

@ -718,6 +718,23 @@ tty_cmd_deletecharacter(struct tty *tty, const struct tty_ctx *ctx)
tty_emulate_repeat(tty, TTYC_DCH, TTYC_DCH1, ctx->num);
}
void
tty_cmd_clearcharacter(struct tty *tty, const struct tty_ctx *ctx)
{
u_int i;
tty_reset(tty);
tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);
if (tty_term_has(tty->term, TTYC_ECH))
tty_putcode1(tty, TTYC_ECH, ctx->num);
else {
for (i = 0; i < ctx->num; i++)
tty_putc(tty, ' ');
}
}
void
tty_cmd_insertline(struct tty *tty, const struct tty_ctx *ctx)
{