mirror of
https://github.com/tmux/tmux.git
synced 2025-01-06 07:48:48 +00:00
Remove the monitor-content option and associated bits and bobs. It's
never worked very well. If there is a big demand for it to return, will consider better ways to do it.
This commit is contained in:
parent
5acee1c04e
commit
992ef70fb6
2
format.c
2
format.c
@ -487,8 +487,6 @@ format_winlink(struct format_tree *ft, struct session *s, struct winlink *wl)
|
||||
|
||||
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",
|
||||
|
@ -491,11 +491,6 @@ const struct options_table_entry session_options_table[] = {
|
||||
.default_num = 0
|
||||
},
|
||||
|
||||
{ .name = "visual-content",
|
||||
.type = OPTIONS_TABLE_FLAG,
|
||||
.default_num = 0
|
||||
},
|
||||
|
||||
{ .name = "visual-silence",
|
||||
.type = OPTIONS_TABLE_FLAG,
|
||||
.default_num = 0
|
||||
@ -629,11 +624,6 @@ const struct options_table_entry window_options_table[] = {
|
||||
.default_num = 0
|
||||
},
|
||||
|
||||
{ .name = "monitor-content",
|
||||
.type = OPTIONS_TABLE_STRING,
|
||||
.default_str = ""
|
||||
},
|
||||
|
||||
{ .name = "monitor-silence",
|
||||
.type = OPTIONS_TABLE_NUMBER,
|
||||
.minimum = 0,
|
||||
@ -735,29 +725,6 @@ const struct options_table_entry window_options_table[] = {
|
||||
.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,
|
||||
|
@ -27,19 +27,16 @@
|
||||
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);
|
||||
@ -55,8 +52,6 @@ server_window_loop(void)
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -187,48 +182,6 @@ server_window_check_silence(struct session *s, struct winlink *wl)
|
||||
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)
|
||||
|
2
status.c
2
status.c
@ -638,8 +638,6 @@ status_print(
|
||||
|
||||
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");
|
||||
|
||||
|
33
tmux.1
33
tmux.1
@ -2644,15 +2644,6 @@ through to the terminal (which normally makes a sound).
|
||||
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
|
||||
@ -2834,14 +2825,6 @@ option.
|
||||
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
|
||||
@ -2914,14 +2897,6 @@ see the
|
||||
.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 ,
|
||||
@ -3124,7 +3099,6 @@ The following variables are available, where appropriate:
|
||||
.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"
|
||||
@ -3286,18 +3260,15 @@ The flag is one of the following symbols appended to the window name:
|
||||
.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
|
||||
|
6
tmux.h
6
tmux.h
@ -990,10 +990,8 @@ struct winlink {
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user