diff options
author | 2013-01-15 23:18:55 +0000 | |
---|---|---|
committer | 2013-01-15 23:18:55 +0000 | |
commit | f752bf020cc55758eeed4fb10e82c12a8c675f6e (patch) | |
tree | 4ab216bb6c3fcc12c7105626e188b06eba864c4a /usr.bin/tmux/tty.c | |
parent | More syncing with FreeBSD bge version. No binary change. (diff) | |
download | wireguard-openbsd-f752bf020cc55758eeed4fb10e82c12a8c675f6e.tar.xz wireguard-openbsd-f752bf020cc55758eeed4fb10e82c12a8c675f6e.zip |
Implement ECH (erase character, CSI X). Reported by Christian Neukirchen.
Diffstat (limited to 'usr.bin/tmux/tty.c')
-rw-r--r-- | usr.bin/tmux/tty.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c index 6f60de4ecdf..1a1dba980e6 100644 --- a/usr.bin/tmux/tty.c +++ b/usr.bin/tmux/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.145 2012/11/22 14:41:11 nicm Exp $ */ +/* $OpenBSD: tty.c,v 1.146 2013/01/15 23:18:55 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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) || |