Emulate dch/dch1 if missing by redrawing the entire line.

pull/1/head
Nicholas Marriott 2009-08-21 12:29:59 +00:00
parent 915a1913e1
commit 926b52b600
2 changed files with 6 additions and 6 deletions

View File

@ -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

8
tty.c
View File

@ -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