diff --git a/tty-term.c b/tty-term.c index aac1f8c7..2d7bcae9 100644 --- a/tty-term.c +++ b/tty-term.c @@ -1,4 +1,4 @@ -/* $Id: tty-term.c,v 1.28 2009-08-09 16:52:06 tcunha Exp $ */ +/* $Id: tty-term.c,v 1.29 2009-08-21 21:15:00 tcunha Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -337,10 +337,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/tty.c b/tty.c index ef47391c..74dd6f8e 100644 --- a/tty.c +++ b/tty.c @@ -1,4 +1,4 @@ -/* $Id: tty.c,v 1.129 2009-08-19 09:00:06 nicm Exp $ */ +/* $Id: tty.c,v 1.130 2009-08-21 21:15:00 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -604,7 +604,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; } @@ -612,7 +614,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