aboutsummaryrefslogtreecommitdiff
path: root/screen-redraw.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-02-11 23:16:45 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-02-11 23:16:45 +0000
commit959eeef5052c44bddee7bc46da55e4129345b1cb (patch)
tree60e0287addb2270a664751408b9e7d74dc151167 /screen-redraw.c
parent4ddac7f0b38aa8ccdd8d704bc7c9329d4e70c55a (diff)
downloadrtmux-959eeef5052c44bddee7bc46da55e4129345b1cb.tar.gz
rtmux-959eeef5052c44bddee7bc46da55e4129345b1cb.tar.bz2
rtmux-959eeef5052c44bddee7bc46da55e4129345b1cb.zip
FreeBSD's console wraps lines at $COLUMNS - 1 rather than $COLUMNS (the cursor can never be beyond $COLUMNS - 1) and does not appear to support changing this behaviour, or any of the obvious possibilities (turning off right margin wrapping, insert mode). This is irritating, most notably because it impossible to write to the very bottom-right of the screen without scrolling. To work around this, if built on FreeBSD and run with a "cons" $TERM, the bottom-right cell on the screen is omitted.
Diffstat (limited to 'screen-redraw.c')
-rw-r--r--screen-redraw.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/screen-redraw.c b/screen-redraw.c
index 68b4223c..2043ad19 100644
--- a/screen-redraw.c
+++ b/screen-redraw.c
@@ -1,4 +1,4 @@
-/* $Id: screen-redraw.c,v 1.23 2009-02-11 17:50:33 nicm Exp $ */
+/* $Id: screen-redraw.c,v 1.24 2009-02-11 23:16:41 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -134,6 +134,11 @@ 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);