diff options
author | 2020-04-17 22:16:28 +0000 | |
---|---|---|
committer | 2020-04-17 22:16:28 +0000 | |
commit | ebfd2033e309985d02ed10df3d5625fa61019608 (patch) | |
tree | ef0957d02eb0733488b34b82e423819d8dc16fe9 /usr.bin/tmux/server-client.c | |
parent | Do not move the cursor to the existing y position if it is invalid, go (diff) | |
download | wireguard-openbsd-ebfd2033e309985d02ed10df3d5625fa61019608.tar.xz wireguard-openbsd-ebfd2033e309985d02ed10df3d5625fa61019608.zip |
Set mode properly before and after redrawing, and don't bother
calculating cursor position if it won't be used.
Diffstat (limited to 'usr.bin/tmux/server-client.c')
-rw-r--r-- | usr.bin/tmux/server-client.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c index 2ae2a0d4e32..985962dc2de 100644 --- a/usr.bin/tmux/server-client.c +++ b/usr.bin/tmux/server-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-client.c,v 1.319 2020/04/16 14:25:35 nicm Exp $ */ +/* $OpenBSD: server-client.c,v 1.320 2020/04/17 22:16:28 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -1681,7 +1681,7 @@ server_client_check_redraw(struct client *c) struct session *s = c->session; struct tty *tty = &c->tty; struct window_pane *wp; - int needed, flags; + int needed, flags, mode = tty->mode; struct timeval tv = { .tv_usec = 1000 }; static struct event ev; size_t left; @@ -1732,6 +1732,7 @@ server_client_check_redraw(struct client *c) flags = tty->flags & (TTY_BLOCK|TTY_FREEZE|TTY_NOCURSOR); tty->flags = (tty->flags & ~(TTY_BLOCK|TTY_FREEZE)) | TTY_NOCURSOR; + tty_update_mode(tty, mode, NULL); if (~c->flags & CLIENT_REDRAWWINDOW) { /* @@ -1752,8 +1753,9 @@ server_client_check_redraw(struct client *c) screen_redraw_screen(c); } - tty->flags = (tty->flags & ~(TTY_FREEZE|TTY_NOCURSOR)) | flags; - tty_update_mode(tty, tty->mode, NULL); + tty->flags = (tty->flags & ~TTY_NOCURSOR) | (flags & TTY_NOCURSOR); + tty_update_mode(tty, mode, NULL); + tty->flags = (tty->flags & ~(TTY_BLOCK|TTY_FREEZE|TTY_NOCURSOR)) | flags; c->flags &= ~(CLIENT_ALLREDRAWFLAGS|CLIENT_STATUSFORCE); |