Add an option to alert (monitor) for silence (lack of activity) in a

window. From Thomas Adam.
This commit is contained in:
Nicholas Marriott
2010-12-06 22:52:21 +00:00
parent d0adcbc98a
commit 3a4f765a51
9 changed files with 101 additions and 11 deletions

View File

@ -1,4 +1,4 @@
/* $Id: window.c,v 1.141 2010-12-06 21:53:50 nicm Exp $ */
/* $Id: window.c,v 1.142 2010-12-06 22:52:21 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -636,6 +636,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 */