From a9a097e56b7430837bc9bfe5991fa26d2203ff16 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 11 May 2015 10:10:16 +0000 Subject: [PATCH] Remove the c0-* options which never really worked satisfactorily. Going to try something else... --- usr.bin/tmux/input.c | 18 ++++-------------- usr.bin/tmux/tmux.1 | 22 ++-------------------- usr.bin/tmux/tmux.h | 7 +------ usr.bin/tmux/window.c | 42 +----------------------------------------- 4 files changed, 8 insertions(+), 81 deletions(-) diff --git a/usr.bin/tmux/input.c b/usr.bin/tmux/input.c index 2d9f0020f28..777a406ef31 100644 --- a/usr.bin/tmux/input.c +++ b/usr.bin/tmux/input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: input.c,v 1.74 2015/05/08 16:18:04 nicm Exp $ */ +/* $OpenBSD: input.c,v 1.75 2015/05/11 10:10:16 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -1069,7 +1069,6 @@ input_c0_dispatch(struct input_ctx *ictx) struct screen_write_ctx *sctx = &ictx->ctx; struct window_pane *wp = ictx->wp; struct screen *s = sctx->s; - u_int trigger; log_debug("%s: '%c", __func__, ictx->ch); @@ -1081,7 +1080,7 @@ input_c0_dispatch(struct input_ctx *ictx) break; case '\010': /* BS */ screen_write_backspace(sctx); - goto count_c0; + break; case '\011': /* HT */ /* Don't tab beyond the end of the line. */ if (s->cx >= screen_size_x(s) - 1) @@ -1098,10 +1097,10 @@ input_c0_dispatch(struct input_ctx *ictx) case '\013': /* VT */ case '\014': /* FF */ screen_write_linefeed(sctx, 0); - goto count_c0; + break; case '\015': /* CR */ screen_write_carriagereturn(sctx); - goto count_c0; + break; case '\016': /* SO */ ictx->cell.set = 1; break; @@ -1113,15 +1112,6 @@ input_c0_dispatch(struct input_ctx *ictx) break; } - return (0); - -count_c0: - trigger = options_get_number(&wp->window->options, "c0-change-trigger"); - if (trigger != 0 && ++wp->changes >= trigger) { - wp->flags |= PANE_DROP; - window_pane_timer_start(wp); - } - return (0); } diff --git a/usr.bin/tmux/tmux.1 b/usr.bin/tmux/tmux.1 index 1b7018bdf93..99e46ffa2a9 100644 --- a/usr.bin/tmux/tmux.1 +++ b/usr.bin/tmux/tmux.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: tmux.1,v 1.427 2015/05/08 16:18:04 nicm Exp $ +.\" $OpenBSD: tmux.1,v 1.428 2015/05/11 10:10:16 nicm Exp $ .\" .\" Copyright (c) 2007 Nicholas Marriott .\" @@ -14,7 +14,7 @@ .\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING .\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: May 8 2015 $ +.Dd $Mdocdate: May 11 2015 $ .Dt TMUX 1 .Os .Sh NAME @@ -2886,24 +2886,6 @@ used when the .Ic automatic-rename option is enabled. .Pp -.It Ic c0-change-interval Ar interval -.It Ic c0-change-trigger Ar trigger -These two options configure a simple form of rate limiting for a pane. -If -.Nm -sees more than -.Ar trigger -C0 sequences that modify the screen (for example, carriage returns, linefeeds -or backspaces) in one millisecond, it will stop updating the pane immediately and -instead redraw it entirely every -.Ar interval -milliseconds. -This helps to prevent fast output (such as -.Xr yes 1 ) -overwhelming the terminal. -The default is a trigger of 250 and an interval of 100. -A trigger of zero disables the rate limiting. -.Pp .It Ic clock-mode-colour Ar colour Set clock colour. .Pp diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h index a75235b169a..72fa6b7e6d9 100644 --- a/usr.bin/tmux/tmux.h +++ b/usr.bin/tmux/tmux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.h,v 1.511 2015/05/08 16:48:12 nicm Exp $ */ +/* $OpenBSD: tmux.h,v 1.512 2015/05/11 10:10:16 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -844,10 +844,6 @@ struct window_pane { char tty[TTY_NAME_MAX]; int status; - u_int changes; - struct event changes_timer; - u_int changes_redraw; - int fd; struct bufferevent *event; @@ -2107,7 +2103,6 @@ struct window_pane *window_pane_find_by_id_str(const char *); 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 *, int, char **, const char *, const char *, int, struct environ *, struct termios *, char **); diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c index 6464ce64c6d..3bbd1933c64 100644 --- a/usr.bin/tmux/window.c +++ b/usr.bin/tmux/window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window.c,v 1.129 2015/05/07 11:42:56 nicm Exp $ */ +/* $OpenBSD: window.c,v 1.130 2015/05/11 10:10:16 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -58,7 +58,6 @@ u_int next_window_pane_id; u_int next_window_id; u_int next_active_point; -void window_pane_timer_callback(int, short, void *); void window_pane_read_callback(struct bufferevent *, void *); void window_pane_error_callback(struct bufferevent *, short, void *); @@ -741,9 +740,6 @@ window_pane_destroy(struct window_pane *wp) { window_pane_reset_mode(wp); - if (event_initialized(&wp->changes_timer)) - evtimer_del(&wp->changes_timer); - if (wp->fd != -1) { bufferevent_free(wp->event); close(wp->fd); @@ -877,42 +873,6 @@ window_pane_spawn(struct window_pane *wp, int argc, char **argv, return (0); } -void -window_pane_timer_start(struct window_pane *wp) -{ - struct timeval tv; - - tv.tv_sec = 0; - tv.tv_usec = 1000; - - evtimer_del(&wp->changes_timer); - evtimer_set(&wp->changes_timer, window_pane_timer_callback, wp); - evtimer_add(&wp->changes_timer, &tv); -} - -void -window_pane_timer_callback(unused int fd, unused short events, void *data) -{ - struct window_pane *wp = data; - struct window *w = wp->window; - u_int interval, trigger; - - interval = options_get_number(&w->options, "c0-change-interval"); - trigger = options_get_number(&w->options, "c0-change-trigger"); - - if (wp->changes_redraw++ == interval) { - wp->flags |= PANE_REDRAW; - wp->changes_redraw = 0; - } - - if (trigger == 0 || wp->changes < trigger) { - wp->flags |= PANE_REDRAW; - wp->flags &= ~PANE_DROP; - } else - window_pane_timer_start(wp); - wp->changes = 0; -} - void window_pane_read_callback(unused struct bufferevent *bufev, void *data) { -- 2.20.1