summaryrefslogtreecommitdiff
path: root/usr.bin/tmux
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-08-21 12:30:00 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-08-21 12:30:00 +0000
commit0cb99f2749271e488c6eca9783d527cdd1e75304 (patch)
tree47ea38db35d5feccd1f85d41ce2a82db6cfef48c /usr.bin/tmux
parentc3b17649e10ff255eabce5fcb45b79df5af9527e (diff)
Emulate dch/dch1 if missing by redrawing the entire line.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r--usr.bin/tmux/tty-term.c6
-rw-r--r--usr.bin/tmux/tty.c10
2 files changed, 8 insertions, 8 deletions
diff --git a/usr.bin/tmux/tty-term.c b/usr.bin/tmux/tty-term.c
index 195ed55e546..d3f5d664619 100644
--- a/usr.bin/tmux/tty-term.c
+++ b/usr.bin/tmux/tty-term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty-term.c,v 1.7 2009/08/05 19:05:02 nicm Exp $ */
+/* $OpenBSD: tty-term.c,v 1.8 2009/08/21 12:29:59 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -338,10 +338,6 @@ tty_term_find(char *name, int fd, const char *overrides, char **cause)
"terminal does not support ich1 or ich or smir and rmir");
goto error;
}
- if (!tty_term_has(term, TTYC_DCH1) && !tty_term_has(term, TTYC_DCH)) {
- xasprintf(cause, "terminal does not support dch1 or dch");
- goto error;
- }
/*
* Figure out if terminal support default colours. AX is a screen
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