From 44f8e1caffce2e887682c3314ee22becc09e1d3c Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Tue, 15 Jan 2013 23:18:55 +0000 Subject: Implement ECH (erase character, CSI X). Reported by Christian Neukirchen. --- tty.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tty.c') diff --git a/tty.c b/tty.c index 6bc7139c..a650c836 100644 --- a/tty.c +++ b/tty.c @@ -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) { -- cgit