aboutsummaryrefslogtreecommitdiff
path: root/window.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2010-12-06 22:51:02 +0000
committerNicholas Marriott <nicm@openbsd.org>2010-12-06 22:51:02 +0000
commite26a351865a0d969b3f40ca3c14be7ff8d7533ad (patch)
tree4ac1f40063ffa767d37ecfe5019d2718635b502d /window.c
parentebd0eb4fb4790cbf289a0dace00e37fe866c9bf3 (diff)
downloadrtmux-e26a351865a0d969b3f40ca3c14be7ff8d7533ad.tar.gz
rtmux-e26a351865a0d969b3f40ca3c14be7ff8d7533ad.tar.bz2
rtmux-e26a351865a0d969b3f40ca3c14be7ff8d7533ad.zip
Add an option to alert (monitor) for silence (lack of activity) in a
window. From Thomas Adam.
Diffstat (limited to 'window.c')
-rw-r--r--window.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/window.c b/window.c
index a7a5c40e..95877cb5 100644
--- a/window.c
+++ b/window.c
@@ -639,6 +639,14 @@ window_pane_read_callback(unused struct bufferevent *bufev, void *data)
input_parse(wp);
wp->pipe_off = EVBUFFER_LENGTH(wp->event->input);
+
+ /*
+ * If we get here, we're not outputting anymore, so set the silence
+ * flag on the window.
+ */
+ wp->window->flags |= WINDOW_SILENCE;
+ if (gettimeofday(&wp->window->silence_timer, NULL) != 0)
+ fatal("gettimeofday failed.");
}
/* ARGSUSED */