mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-23 08:33:17 +01:00
Sync OpenBSD patchset 240:
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).
This commit is contained in:
parent
e8ea3ccd58
commit
c261ae32d2
@ -1,4 +1,4 @@
|
|||||||
/* $Id: screen-redraw.c,v 1.44 2009-07-31 20:35:21 tcunha Exp $ */
|
/* $Id: screen-redraw.c,v 1.45 2009-08-10 21:41:35 tcunha Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* 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 only drawing status and it is present, don't need the rest. */
|
||||||
if (status_only && status) {
|
if (status_only && status) {
|
||||||
tty_draw_line(tty, &c->status, 0, 0, tty->sy - 1);
|
tty_draw_line(tty, &c->status, 0, 0, tty->sy - 1);
|
||||||
|
tty_reset(tty);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,6 +215,7 @@ screen_redraw_screen(struct client *c, int status_only)
|
|||||||
/* Draw the status line. */
|
/* Draw the status line. */
|
||||||
if (status)
|
if (status)
|
||||||
tty_draw_line(tty, &c->status, 0, 0, tty->sy - 1);
|
tty_draw_line(tty, &c->status, 0, 0, tty->sy - 1);
|
||||||
|
tty_reset(tty);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Draw a single pane. */
|
/* 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++)
|
for (i = 0; i < wp->sy; i++)
|
||||||
tty_draw_line(&c->tty, wp->screen, i, wp->xoff, wp->yoff);
|
tty_draw_line(&c->tty, wp->screen, i, wp->xoff, wp->yoff);
|
||||||
|
tty_reset(&c->tty);
|
||||||
}
|
}
|
||||||
|
3
server.c
3
server.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: server.c,v 1.165 2009-08-09 17:19:18 tcunha Exp $ */
|
/* $Id: server.c,v 1.166 2009-08-10 21:41:35 tcunha Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -871,6 +871,7 @@ server_handle_client(struct client *c)
|
|||||||
|
|
||||||
/* Ensure cursor position and mode settings. */
|
/* Ensure cursor position and mode settings. */
|
||||||
status = options_get_number(&c->session->options, "status");
|
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)
|
if (!window_pane_visible(wp) || wp->yoff + s->cy >= c->tty.sy - status)
|
||||||
tty_cursor(&c->tty, 0, 0, 0, 0);
|
tty_cursor(&c->tty, 0, 0, 0, 0);
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user