From f59971276ac02d8b42ef222509673ff356800f56 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Tue, 20 Mar 2012 11:01:00 +0000 Subject: Add a simple form of output rate limiting by counting the number of certain C0 sequences (linefeeds, backspaces, carriage returns) and if it exceeds a threshold (current default 50/millisecond), start to redraw the pane every 100 milliseconds instead of making each change as it comes. Two configuration options - c0-change-trigger and c0-change-interval. This makes tmux much more responsive under very fast output (for example yes(1) or accidentally cat'ing a large file) but may not be perfect on all terminals and connections - feedback very welcome, particularly where this change has a negative rather than positive effect (making it off by default is a possibility). After much experimentation based originally on a request Robin Lee Powell (which ended with a completely different solution), this idea from discussion with Ailin Nemui. --- tmux.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tmux.h') diff --git a/tmux.h b/tmux.h index 8d0b680f..87a15485 100644 --- a/tmux.h +++ b/tmux.h @@ -811,6 +811,7 @@ struct window_pane { int flags; #define PANE_REDRAW 0x1 +#define PANE_DROP 0x2 char *cmd; char *shell; @@ -819,6 +820,10 @@ struct window_pane { pid_t pid; char tty[TTY_NAME_MAX]; + u_int changes; + struct event changes_timer; + u_int changes_redraw; + int fd; struct bufferevent *event; @@ -1963,6 +1968,7 @@ void window_destroy_panes(struct window *); struct window_pane *window_pane_find_by_id(u_int); struct window_pane *window_pane_create(struct window *, u_int, u_int, u_int); void window_pane_destroy(struct window_pane *); +void window_pane_timer_start(struct window_pane *); int window_pane_spawn(struct window_pane *, const char *, const char *, const char *, struct environ *, struct termios *, char **); @@ -1981,7 +1987,6 @@ int window_pane_visible(struct window_pane *); char *window_pane_search( struct window_pane *, const char *, u_int *); char *window_printable_flags(struct session *, struct winlink *); - struct window_pane *window_pane_find_up(struct window_pane *); struct window_pane *window_pane_find_down(struct window_pane *); struct window_pane *window_pane_find_left(struct window_pane *); -- cgit