summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/window.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2020-04-06 17:51:35 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2020-04-06 17:51:35 +0000
commit9e4be60fe582ac5246804ad6b86db7e34a51c15f (patch)
tree0278083e5362040020f43d3d897cba78481a8ff9 /usr.bin/tmux/window.c
parentcb8b407f23ba21e079f61a1d233b3678a373e4d7 (diff)
Change copy mode to make copy of the pane history so it does not need to
freeze updates (which does not play nicely with some applications, a longstanding problem) and will allow some other changes later. From Anindya Mukherjee.
Diffstat (limited to 'usr.bin/tmux/window.c')
-rw-r--r--usr.bin/tmux/window.c29
1 files changed, 1 insertions, 28 deletions
diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c
index 697f0cc03cc..b964022d334 100644
--- a/usr.bin/tmux/window.c
+++ b/usr.bin/tmux/window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window.c,v 1.252 2020/03/31 07:00:34 nicm Exp $ */
+/* $OpenBSD: window.c,v 1.253 2020/04/06 17:51:34 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1066,40 +1066,15 @@ window_pane_get_palette(struct window_pane *wp, int c)
return (new);
}
-static void
-window_pane_mode_timer(__unused int fd, __unused short events, void *arg)
-{
- struct window_pane *wp = arg;
- struct timeval tv = { .tv_sec = 10 };
- int n = 0;
-
- evtimer_del(&wp->modetimer);
- evtimer_add(&wp->modetimer, &tv);
-
- log_debug("%%%u in mode: last=%ld", wp->id, (long)wp->modelast);
-
- if (wp->modelast < time(NULL) - WINDOW_MODE_TIMEOUT) {
- if (ioctl(wp->fd, FIONREAD, &n) == -1 || n > 0)
- window_pane_reset_mode_all(wp);
- }
-}
-
int
window_pane_set_mode(struct window_pane *wp, const struct window_mode *mode,
struct cmd_find_state *fs, struct args *args)
{
- struct timeval tv = { .tv_sec = 10 };
struct window_mode_entry *wme;
if (!TAILQ_EMPTY(&wp->modes) && TAILQ_FIRST(&wp->modes)->mode == mode)
return (1);
- wp->modelast = time(NULL);
- if (TAILQ_EMPTY(&wp->modes)) {
- evtimer_set(&wp->modetimer, window_pane_mode_timer, wp);
- evtimer_add(&wp->modetimer, &tv);
- }
-
TAILQ_FOREACH(wme, &wp->modes, entry) {
if (wme->mode == mode)
break;
@@ -1141,7 +1116,6 @@ window_pane_reset_mode(struct window_pane *wp)
next = TAILQ_FIRST(&wp->modes);
if (next == NULL) {
log_debug("%s: no next mode", __func__);
- evtimer_del(&wp->modetimer);
wp->screen = &wp->base;
} else {
log_debug("%s: next mode is %s", __func__, next->mode->name);
@@ -1174,7 +1148,6 @@ window_pane_key(struct window_pane *wp, struct client *c, struct session *s,
wme = TAILQ_FIRST(&wp->modes);
if (wme != NULL) {
- wp->modelast = time(NULL);
if (wme->mode->key != NULL)
wme->mode->key(wme, c, s, wl, (key & ~KEYC_XTERM), m);
return (0);