-/* $OpenBSD: format.c,v 1.42 2014/04/02 18:12:18 nicm Exp $ */
+/* $OpenBSD: format.c,v 1.43 2014/04/17 07:36:45 nicm Exp $ */
/*
* Copyright (c) 2011 Nicholas Marriott <nicm@users.sourceforge.net>
format_add(ft, "window_bell_flag", "%u",
!!(wl->flags & WINLINK_BELL));
- format_add(ft, "window_content_flag", "%u",
- !!(wl->flags & WINLINK_CONTENT));
format_add(ft, "window_activity_flag", "%u",
!!(wl->flags & WINLINK_ACTIVITY));
format_add(ft, "window_silence_flag", "%u",
-/* $OpenBSD: options-table.c,v 1.46 2014/03/31 21:41:35 nicm Exp $ */
+/* $OpenBSD: options-table.c,v 1.47 2014/04/17 07:36:45 nicm Exp $ */
/*
* Copyright (c) 2011 Nicholas Marriott <nicm@users.sourceforge.net>
.default_num = 0
},
- { .name = "visual-content",
- .type = OPTIONS_TABLE_FLAG,
- .default_num = 0
- },
-
{ .name = "visual-silence",
.type = OPTIONS_TABLE_FLAG,
.default_num = 0
.default_num = 0
},
- { .name = "monitor-content",
- .type = OPTIONS_TABLE_STRING,
- .default_str = ""
- },
-
{ .name = "monitor-silence",
.type = OPTIONS_TABLE_NUMBER,
.minimum = 0,
.style = "window-status-style"
},
- { .name = "window-status-content-attr",
- .type = OPTIONS_TABLE_ATTRIBUTES,
- .default_num = GRID_ATTR_REVERSE,
- .style = "window-status-content-style"
- },
-
- { .name = "window-status-content-bg",
- .type = OPTIONS_TABLE_COLOUR,
- .default_num = 8,
- .style = "window-status-content-style"
- },
-
- { .name = "window-status-content-fg",
- .type = OPTIONS_TABLE_COLOUR,
- .default_num = 8,
- .style = "window-status-content-style"
- },
-
- { .name = "window-status-content-style",
- .type = OPTIONS_TABLE_STYLE,
- .default_str = "reverse"
- },
-
{ .name = "window-status-current-attr",
.type = OPTIONS_TABLE_ATTRIBUTES,
.default_num = 0,
-/* $OpenBSD: server-window.c,v 1.30 2014/04/02 17:14:24 nicm Exp $ */
+/* $OpenBSD: server-window.c,v 1.31 2014/04/17 07:36:45 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
int server_window_check_bell(struct session *, struct winlink *);
int server_window_check_activity(struct session *, struct winlink *);
int server_window_check_silence(struct session *, struct winlink *);
-int server_window_check_content(
- struct session *, struct winlink *, struct window_pane *);
void ring_bell(struct session *);
/* Window functions that need to happen every loop. */
void
server_window_loop(void)
{
- struct window *w;
- struct winlink *wl;
- struct window_pane *wp;
- struct session *s;
- u_int i;
+ struct window *w;
+ struct winlink *wl;
+ struct session *s;
+ u_int i;
for (i = 0; i < ARRAY_LENGTH(&windows); i++) {
w = ARRAY_ITEM(&windows, i);
server_window_check_activity(s, wl) ||
server_window_check_silence(s, wl))
server_status_session(s);
- TAILQ_FOREACH(wp, &w->panes, entry)
- server_window_check_content(s, wl, wp);
}
}
}
return (1);
}
-/* Check for content change in window. */
-int
-server_window_check_content(
- struct session *s, struct winlink *wl, struct window_pane *wp)
-{
- struct client *c;
- struct window *w = wl->window;
- u_int i;
- char *found, *ptr;
-
- /* Activity flag must be set for new content. */
- if (s->curw->window == w)
- w->flags &= ~WINDOW_ACTIVITY;
-
- if (!(w->flags & WINDOW_ACTIVITY) || wl->flags & WINLINK_CONTENT)
- return (0);
- if (s->curw == wl && !(s->flags & SESSION_UNATTACHED))
- return (0);
-
- ptr = options_get_string(&w->options, "monitor-content");
- if (ptr == NULL || *ptr == '\0')
- return (0);
- if ((found = window_pane_search(wp, ptr, NULL)) == NULL)
- return (0);
- free(found);
-
- if (options_get_number(&s->options, "bell-on-alert"))
- ring_bell(s);
- wl->flags |= WINLINK_CONTENT;
-
- if (options_get_number(&s->options, "visual-content")) {
- for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
- c = ARRAY_ITEM(&clients, i);
- if (c == NULL || c->session != s)
- continue;
- status_message_set(c, "Content in window %u", wl->idx);
- }
- }
-
- return (1);
-}
-
/* Ring terminal bell. */
void
ring_bell(struct session *s)
-/* $OpenBSD: status.c,v 1.112 2014/04/02 17:08:23 nicm Exp $ */
+/* $OpenBSD: status.c,v 1.113 2014/04/17 07:36:45 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
if (wl->flags & WINLINK_BELL)
style_apply_update(gc, oo, "window-status-bell-style");
- else if (wl->flags & WINLINK_CONTENT)
- style_apply_update(gc, oo, "window-status-content-style");
else if (wl->flags & (WINLINK_ACTIVITY|WINLINK_SILENCE))
style_apply_update(gc, oo, "window-status-activity-style");
-.\" $OpenBSD: tmux.1,v 1.387 2014/04/16 21:02:41 nicm Exp $
+.\" $OpenBSD: tmux.1,v 1.388 2014/04/17 07:36:45 nicm Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
.\"
.\" 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: April 16 2014 $
+.Dd $Mdocdate: April 17 2014 $
.Dt TMUX 1
.Os
.Sh NAME
Also see the
.Ic bell-action
option.
-.It Xo Ic visual-content
-.Op Ic on | off
-.Xc
-Like
-.Ic visual-activity ,
-display a message when content is present in a window
-for which the
-.Ic monitor-content
-window option is enabled.
.It Xo Ic visual-silence
.Op Ic on | off
.Xc
Monitor for activity in the window.
Windows with activity are highlighted in the status line.
.Pp
-.It Ic monitor-content Ar match-string
-Monitor content in the window.
-When
-.Xr fnmatch 3
-pattern
-.Ar match-string
-appears in the window, it is highlighted in the status line.
-.Pp
.It Xo Ic monitor-silence
.Op Ic interval
.Xc
.Ic message-command-style
option.
.Pp
-.It Ic window-status-content-style Ar style
-Set status line style for windows with a content alert.
-For how to specify
-.Ar style ,
-see the
-.Ic message-command-style
-option.
-.Pp
.It Ic window-status-current-format Ar string
Like
.Ar window-status-format ,
.It Li "window_active" Ta "" Ta "1 if window active"
.It Li "window_activity_flag" Ta "" Ta "1 if window has activity alert"
.It Li "window_bell_flag" Ta "" Ta "1 if window has bell"
-.It Li "window_content_flag" Ta "" Ta "1 if window has content alert"
.It Li "window_find_matches" Ta "" Ta "Matched data from the find-window"
.It Li "window_flags" Ta "#F" Ta "Window flags"
.It Li "window_height" Ta "" Ta "Height of window"
.It Li "-" Ta "Marks the last window (previously selected)."
.It Li "#" Ta "Window is monitored and activity has been detected."
.It Li "!" Ta "A bell has occurred in the window."
-.It Li "+" Ta "Window is monitored for content and it has appeared."
.It Li "~" Ta "The window has been silent for the monitor-silence interval."
.It Li "Z" Ta "The window's active pane is zoomed."
.El
.Pp
The # symbol relates to the
.Ic monitor-activity
-and + to the
-.Ic monitor-content
-window options.
+window option.
The window name is printed in inverted colours if an alert (bell, activity or
-content) is present.
+silence) is present.
.Pp
The colour and attributes of the status line may be configured, the entire
status line using the
-/* $OpenBSD: tmux.h,v 1.450 2014/04/16 21:16:19 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.451 2014/04/17 07:36:45 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
int flags;
#define WINLINK_BELL 0x1
#define WINLINK_ACTIVITY 0x2
-#define WINLINK_CONTENT 0x4
-#define WINLINK_SILENCE 0x8
-#define WINLINK_ALERTFLAGS \
- (WINLINK_BELL|WINLINK_ACTIVITY|WINLINK_CONTENT|WINLINK_SILENCE)
+#define WINLINK_SILENCE 0x4
+#define WINLINK_ALERTFLAGS (WINLINK_BELL|WINLINK_ACTIVITY|WINLINK_SILENCE)
RB_ENTRY(winlink) entry;
TAILQ_ENTRY(winlink) sentry;
-/* $OpenBSD: window.c,v 1.103 2014/03/31 21:41:07 nicm Exp $ */
+/* $OpenBSD: window.c,v 1.104 2014/04/17 07:36:45 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
flags[pos++] = '#';
if (wl->flags & WINLINK_BELL)
flags[pos++] = '!';
- if (wl->flags & WINLINK_CONTENT)
- flags[pos++] = '+';
if (wl->flags & WINLINK_SILENCE)
flags[pos++] = '~';
if (wl == s->curw)