From e6ed1cc44f2cba841434781dc42384e48e251cc6 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Thu, 12 Feb 2009 00:18:05 +0000 Subject: [PATCH] Never draw last character: stops stray scrolling sometimes should status line be disabled. --- screen-redraw.c | 7 +------ tty-term.c | 5 ++++- tty.c | 7 ++++++- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/screen-redraw.c b/screen-redraw.c index 2043ad19..227ba648 100644 --- a/screen-redraw.c +++ b/screen-redraw.c @@ -1,4 +1,4 @@ -/* $Id: screen-redraw.c,v 1.24 2009-02-11 23:16:41 nicm Exp $ */ +/* $Id: screen-redraw.c,v 1.25 2009-02-12 00:18:05 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -134,11 +134,6 @@ screen_redraw_line(struct client *c, struct screen *s, u_int oy, u_int py) sx = screen_size_x(s); if (sx > c->tty.sx) sx = c->tty.sx; - if (c->tty.term->flags & TERM_EARLYWRAP) { - /* Work around weirdness by omitting bottom right character. */ - if (oy + py == c->tty.sy - 1 && sx == c->tty.sx) - sx--; - } for (i = 0; i < sx; i++) { gc = grid_view_peek_cell(s->grid, i, py); tty_cursor(&c->tty, i, py, oy); diff --git a/tty-term.c b/tty-term.c index f273e03e..ea970f47 100644 --- a/tty-term.c +++ b/tty-term.c @@ -1,4 +1,4 @@ -/* $Id: tty-term.c,v 1.13 2009-02-11 23:16:44 nicm Exp $ */ +/* $Id: tty-term.c,v 1.14 2009-02-12 00:18:05 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -218,6 +218,9 @@ tty_term_find(char *name, int fd, char **cause) for (i = 0; i < NTTYCODE; i++) { ent = &tty_term_codes[i]; +// if (ent->code == TTYC_CSR)/*XXX*/ +// continue; + code = &term->codes[ent->code]; code->type = TTYCODE_NONE; switch (ent->type) { diff --git a/tty.c b/tty.c index 004219d5..986bef3e 100644 --- a/tty.c +++ b/tty.c @@ -1,4 +1,4 @@ -/* $Id: tty.c,v 1.72 2009-02-12 00:03:58 nicm Exp $ */ +/* $Id: tty.c,v 1.73 2009-02-12 00:18:05 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -735,6 +735,11 @@ tty_cell(struct tty *tty, const struct grid_cell *gc) u_int i, width; u_char out[4]; + /* Skip last character if terminal is stupid. */ + if (c->tty.term->flags & TERM_EARLYWRAP && + tty->cy == tty->sy - 1 && tty->cx == tty->sx - 1) + return; + /* If this is a padding character, do nothing. */ if (gc->flags & GRID_FLAG_PADDING) return;