Merge branch 'obsd-master' into master

This commit is contained in:
Thomas Adam
2021-12-07 09:52:59 +00:00
11 changed files with 142 additions and 106 deletions

View File

@ -1703,7 +1703,7 @@ server_client_reset_state(struct client *c)
struct window_pane *wp = server_client_get_pane(c), *loop;
struct screen *s = NULL;
struct options *oo = c->session->options;
int mode = 0, cursor, flags;
int mode = 0, cursor, flags, n;
u_int cx = 0, cy = 0, ox, oy, sx, sy;
if (c->flags & (CLIENT_CONTROL|CLIENT_SUSPENDED))
@ -1731,7 +1731,20 @@ server_client_reset_state(struct client *c)
tty_margin_off(tty);
/* Move cursor to pane cursor and offset. */
if (c->overlay_draw == NULL) {
if (c->prompt_string != NULL) {
n = options_get_number(c->session->options, "status-position");
if (n == 0)
cy = 0;
else {
n = status_line_size(c);
if (n == 0)
cy = tty->sy - 1;
else
cy = tty->sy - n;
}
cx = c->prompt_cursor;
mode &= ~MODE_CURSOR;
} else if (c->overlay_draw == NULL) {
cursor = 0;
tty_window_offset(tty, &ox, &oy, &sx, &sy);
if (wp->xoff + s->cx >= ox && wp->xoff + s->cx <= ox + sx &&