summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/tty.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2009-08-21 12:29:59 +0000
committernicm <nicm@openbsd.org>2009-08-21 12:29:59 +0000
commit234cb327764f33261d65aaa283629589f545f51a (patch)
tree2143f181108a30fc3866b81a547e797f967c79dd /usr.bin/tmux/tty.c
parent- change two variables to daddr64_t, eventhough they won't overflow (diff)
downloadwireguard-openbsd-234cb327764f33261d65aaa283629589f545f51a.tar.xz
wireguard-openbsd-234cb327764f33261d65aaa283629589f545f51a.zip
Emulate dch/dch1 if missing by redrawing the entire line.
Diffstat (limited to 'usr.bin/tmux/tty.c')
-rw-r--r--usr.bin/tmux/tty.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c
index 26c5ceb021b..8081c30c56e 100644
--- a/usr.bin/tmux/tty.c
+++ b/usr.bin/tmux/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.25 2009/08/14 08:53:52 nicm Exp $ */
+/* $OpenBSD: tty.c,v 1.26 2009/08/21 12:29:59 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -596,7 +596,9 @@ tty_cmd_deletecharacter(struct tty *tty, const struct tty_ctx *ctx)
struct window_pane *wp = ctx->wp;
struct screen *s = wp->screen;
- if (wp->xoff != 0 || screen_size_x(s) < tty->sx) {
+ if (wp->xoff != 0 || screen_size_x(s) < tty->sx ||
+ (!tty_term_has(tty->term, TTYC_DCH) &&
+ !tty_term_has(tty->term, TTYC_DCH1))) {
tty_draw_line(tty, wp->screen, ctx->ocy, wp->xoff, wp->yoff);
return;
}
@@ -604,7 +606,9 @@ tty_cmd_deletecharacter(struct tty *tty, const struct tty_ctx *ctx)
tty_reset(tty);
tty_cursor(tty, ctx->ocx, ctx->ocy, wp->xoff, wp->yoff);
- tty_emulate_repeat(tty, TTYC_DCH, TTYC_DCH1, ctx->num);
+ if (tty_term_has(tty->term, TTYC_DCH) ||
+ tty_term_has(tty->term, TTYC_DCH1))
+ tty_emulate_repeat(tty, TTYC_DCH, TTYC_DCH1, ctx->num);
}
void