=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/server-client.c,v retrieving revision 1.331 retrieving revision 1.332 diff -c -r1.331 -r1.332 *** src/usr.bin/tmux/server-client.c 2020/04/21 06:32:40 1.331 --- src/usr.bin/tmux/server-client.c 2020/04/21 06:34:13 1.332 *************** *** 1,4 **** ! /* $OpenBSD: server-client.c,v 1.331 2020/04/21 06:32:40 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: server-client.c,v 1.332 2020/04/21 06:34:13 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott *************** *** 1537,1542 **** --- 1537,1543 ---- static void server_client_reset_state(struct client *c) { + struct tty *tty = &c->tty; struct window *w = c->session->curw->window; struct window_pane *wp = w->active, *loop; struct screen *s; *************** *** 1547,1552 **** --- 1548,1557 ---- if (c->flags & (CLIENT_CONTROL|CLIENT_SUSPENDED)) return; + /* Disable the block flag. */ + flags = (tty->flags & TTY_BLOCK); + tty->flags &= ~TTY_BLOCK; + /* Get mode from overlay if any, else from screen. */ if (c->overlay_draw != NULL) { s = NULL; *************** *** 1561,1573 **** log_debug("%s: client %s mode %x", __func__, c->name, mode); /* Reset region and margin. */ ! tty_region_off(&c->tty); ! tty_margin_off(&c->tty); /* Move cursor to pane cursor and offset. */ if (c->overlay_draw == NULL) { cursor = 0; ! tty_window_offset(&c->tty, &ox, &oy, &sx, &sy); if (wp->xoff + s->cx >= ox && wp->xoff + s->cx <= ox + sx && wp->yoff + s->cy >= oy && wp->yoff + s->cy <= oy + sy) { cursor = 1; --- 1566,1578 ---- log_debug("%s: client %s mode %x", __func__, c->name, mode); /* Reset region and margin. */ ! tty_region_off(tty); ! tty_margin_off(tty); /* Move cursor to pane cursor and offset. */ 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 && wp->yoff + s->cy >= oy && wp->yoff + s->cy <= oy + sy) { cursor = 1; *************** *** 1581,1587 **** if (!cursor) mode &= ~MODE_CURSOR; } ! tty_cursor(&c->tty, cx, cy); /* * Set mouse mode if requested. To support dragging, always use button --- 1586,1593 ---- if (!cursor) mode &= ~MODE_CURSOR; } ! log_debug("%s: cursor to %u,%u", __func__, cx, cy); ! tty_cursor(tty, cx, cy); /* * Set mouse mode if requested. To support dragging, always use button *************** *** 1604,1621 **** mode &= ~MODE_BRACKETPASTE; /* Set the terminal mode and reset attributes. */ ! tty_update_mode(&c->tty, mode, s); ! tty_reset(&c->tty); ! /* ! * All writing must be done, send a sync end (if it was started). It ! * may have been started by redrawing so needs to go out even if the ! * block flag is set. ! */ ! flags = (c->tty.flags & TTY_BLOCK); ! c->tty.flags &= ~TTY_BLOCK; ! tty_sync_end(&c->tty); ! c->tty.flags |= flags; } /* Repeat time callback. */ --- 1610,1621 ---- mode &= ~MODE_BRACKETPASTE; /* Set the terminal mode and reset attributes. */ ! tty_update_mode(tty, mode, s); ! tty_reset(tty); ! /* All writing must be done, send a sync end (if it was started). */ ! tty_sync_end(tty); ! tty->flags |= flags; } /* Repeat time callback. */