aboutsummaryrefslogtreecommitdiff
path: root/tty.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2013-01-15 23:18:55 +0000
committerNicholas Marriott <nicm@openbsd.org>2013-01-15 23:18:55 +0000
commit44f8e1caffce2e887682c3314ee22becc09e1d3c (patch)
treea63dd217894d16337ba0880077064fadc5e7077f /tty.c
parentbc2e4a36df2023a738c433779ba8f1e08b6951fe (diff)
downloadrtmux-44f8e1caffce2e887682c3314ee22becc09e1d3c.tar.gz
rtmux-44f8e1caffce2e887682c3314ee22becc09e1d3c.tar.bz2
rtmux-44f8e1caffce2e887682c3314ee22becc09e1d3c.zip
Implement ECH (erase character, CSI X). Reported by Christian Neukirchen.
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/tty.c b/tty.c
index 6bc7139c..a650c836 100644
--- a/tty.c
+++ b/tty.c
@@ -719,6 +719,23 @@ tty_cmd_deletecharacter(struct tty *tty, const struct tty_ctx *ctx)
}
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)
{
if (!tty_pane_full_width(tty, ctx) ||