diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-08-10 19:42:04 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-08-10 19:42:04 +0000 |
commit | 76dcf8783f1187ab9a21a6ebd5fbd6d1263d05c2 (patch) | |
tree | 16371a4dabfdc3ac1d0a12fcc9c49aade82c2b71 /usr.bin | |
parent | be16e44bfdbedb5f7dcbaa439bcf4221406f27ab (diff) |
Reset the attributes after drawing all or part of the screen, and reset the
region before poll(2). This reduces (but does not eliminate) the chance of the
attributes not being normal if tmux is disconnected without warning (ssh ~.,
reboot from inside, etc).
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tmux/screen-redraw.c | 5 | ||||
-rw-r--r-- | usr.bin/tmux/server.c | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/tmux/screen-redraw.c b/usr.bin/tmux/screen-redraw.c index 10a686425f4..b0e334a8a59 100644 --- a/usr.bin/tmux/screen-redraw.c +++ b/usr.bin/tmux/screen-redraw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: screen-redraw.c,v 1.8 2009/07/31 10:12:49 nicm Exp $ */ +/* $OpenBSD: screen-redraw.c,v 1.9 2009/08/10 19:42:03 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -173,6 +173,7 @@ screen_redraw_screen(struct client *c, int status_only) /* If only drawing status and it is present, don't need the rest. */ if (status_only && status) { tty_draw_line(tty, &c->status, 0, 0, tty->sy - 1); + tty_reset(tty); return; } @@ -214,6 +215,7 @@ screen_redraw_screen(struct client *c, int status_only) /* Draw the status line. */ if (status) tty_draw_line(tty, &c->status, 0, 0, tty->sy - 1); + tty_reset(tty); } /* Draw a single pane. */ @@ -224,4 +226,5 @@ screen_redraw_pane(struct client *c, struct window_pane *wp) for (i = 0; i < wp->sy; i++) tty_draw_line(&c->tty, wp->screen, i, wp->xoff, wp->yoff); + tty_reset(&c->tty); } diff --git a/usr.bin/tmux/server.c b/usr.bin/tmux/server.c index ae06d571913..e90ee7e1bf3 100644 --- a/usr.bin/tmux/server.c +++ b/usr.bin/tmux/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.16 2009/08/07 15:39:10 nicm Exp $ */ +/* $OpenBSD: server.c,v 1.17 2009/08/10 19:42:03 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -866,6 +866,7 @@ server_handle_client(struct client *c) /* Ensure cursor position and mode settings. */ status = options_get_number(&c->session->options, "status"); + tty_region(&c->tty, 0, c->tty.sy - 1, 0); if (!window_pane_visible(wp) || wp->yoff + s->cy >= c->tty.sy - status) tty_cursor(&c->tty, 0, 0, 0, 0); else |