diff options
author | nicm <nicm> | 2017-04-19 06:52:27 +0000 |
---|---|---|
committer | nicm <nicm> | 2017-04-19 06:52:27 +0000 |
commit | fa6deb58664739a8073f188a4e3a88a122270537 (patch) | |
tree | 8051621e0d3aff1bcf8f19ea3867eee68d450fd1 /tmux.h | |
parent | f731ae4a2dc6aca565b20dffd6ddf661e585cbb5 (diff) |
When the data we have buffered to write to a terminal grows beyond a
reasonable amount (currently width * height * 8 bytes), discard all
output to the terminal and start trying to redraw periodically
instead. Continue with this until the amount of data we are trying to
write falls to a low level again.
This helps to prevent tmux sitting on a huge buffer of data when there
are processes with fast output running inside tmux but the outside
terminal is slow.
A new client_discarded format holds the amount of data that has been
discarded due to this mechanism.
The three variables (when to start this, when to stop, and how often to
redraw) are basically "works for me" at the moment, this is going in to
see how it goes and if it causes problems for anyone else.
Diffstat (limited to 'tmux.h')
-rw-r--r-- | tmux.h | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1043,7 +1043,8 @@ struct tty { struct evbuffer *in; struct event event_out; struct evbuffer *out; - size_t written; + struct event timer; + size_t discarded; struct termios tio; @@ -1059,6 +1060,7 @@ struct tty { #define TTY_STARTED 0x10 #define TTY_OPENED 0x20 #define TTY_FOCUS 0x40 +#define TTY_BLOCK 0x80 int flags; struct tty_term *term; @@ -1306,6 +1308,9 @@ struct client { char *ttyname; struct tty tty; + size_t written; + size_t discarded; + void (*stdin_callback)(struct client *, int, void *); void *stdin_callback_data; struct evbuffer *stdin_data; |