summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/server-client.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2017-05-09 13:04:36 +0000
committernicm <nicm@openbsd.org>2017-05-09 13:04:36 +0000
commit85789290275a8ea46af594755e2b34e92ea37696 (patch)
treeaafae6abf265946d10c65503ac4e7191c8b821ac /usr.bin/tmux/server-client.c
parentDocument that patches are cumulative and as such it is not possible to install (diff)
downloadwireguard-openbsd-85789290275a8ea46af594755e2b34e92ea37696.tar.xz
wireguard-openbsd-85789290275a8ea46af594755e2b34e92ea37696.zip
If the current screen was complex enough, it was possible to make redraw
itself hit the "terminal can't keep up" check. To avoid this, record how much data we send during redraw (we know we will be starting with 0) and skip the check until it has been flushed. GitHub issue 912.
Diffstat (limited to 'usr.bin/tmux/server-client.c')
-rw-r--r--usr.bin/tmux/server-client.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c
index e33b70d920a..ff3d176fe15 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.229 2017/05/07 21:25:59 nicm Exp $ */
+/* $OpenBSD: server-client.c,v 1.230 2017/05/09 13:04:36 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1314,6 +1314,16 @@ server_client_check_redraw(struct client *c)
c->flags &= ~(CLIENT_REDRAW|CLIENT_BORDERS|CLIENT_STATUS|
CLIENT_STATUSFORCE);
+
+ if (needed) {
+ /*
+ * We would have deferred the redraw unless the output buffer
+ * was empty, so we can record how many bytes the redraw
+ * generated.
+ */
+ c->redraw = EVBUFFER_LENGTH(tty->out);
+ log_debug("%s: redraw added %zu bytes", c->name, c->redraw);
+ }
}
/* Set client title. */