mirror of
https://github.com/tmux/tmux.git
synced 2026-10-12 05:34:24 +00:00
Merge branch 'obsd-master'
This commit is contained in:
22
monitor.c
22
monitor.c
@@ -93,6 +93,18 @@ monitor_get_session(struct monitor_set *ms)
|
|||||||
return (s);
|
return (s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Create a format tree for a subscription. */
|
||||||
|
static struct format_tree *
|
||||||
|
monitor_create_formats(struct client *c, struct session *s, struct winlink *wl,
|
||||||
|
struct window_pane *wp)
|
||||||
|
{
|
||||||
|
struct format_tree *ft;
|
||||||
|
|
||||||
|
ft = format_create(NULL, NULL, FORMAT_NOJOBS, 0);
|
||||||
|
format_defaults(ft, c, s, wl, wp);
|
||||||
|
return (ft);
|
||||||
|
}
|
||||||
|
|
||||||
/* Compare subscriptions. */
|
/* Compare subscriptions. */
|
||||||
static int
|
static int
|
||||||
monitor_item_cmp(struct monitor_item *m1, struct monitor_item *m2)
|
monitor_item_cmp(struct monitor_item *m1, struct monitor_item *m2)
|
||||||
@@ -236,7 +248,7 @@ monitor_check_pane(struct monitor_set *ms, struct monitor_item *me)
|
|||||||
if (wl->session != s)
|
if (wl->session != s)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ft = format_create_defaults(NULL, c, s, wl, wp);
|
ft = monitor_create_formats(c, s, wl, wp);
|
||||||
value = format_expand(ft, me->format);
|
value = format_expand(ft, me->format);
|
||||||
format_free(ft);
|
format_free(ft);
|
||||||
|
|
||||||
@@ -314,7 +326,7 @@ monitor_check_window(struct monitor_set *ms, struct monitor_item *me)
|
|||||||
if (wl->session != s)
|
if (wl->session != s)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ft = format_create_defaults(NULL, c, s, wl, NULL);
|
ft = monitor_create_formats(c, s, wl, NULL);
|
||||||
value = format_expand(ft, me->format);
|
value = format_expand(ft, me->format);
|
||||||
format_free(ft);
|
format_free(ft);
|
||||||
|
|
||||||
@@ -382,7 +394,7 @@ monitor_check_sessions(struct monitor_set *ms)
|
|||||||
struct monitor_item *me, *me1;
|
struct monitor_item *me, *me1;
|
||||||
struct format_tree *ft;
|
struct format_tree *ft;
|
||||||
|
|
||||||
ft = format_create_defaults(NULL, c, s, NULL, NULL);
|
ft = monitor_create_formats(c, s, NULL, NULL);
|
||||||
RB_FOREACH_SAFE(me, monitor_items, &ms->items, me1) {
|
RB_FOREACH_SAFE(me, monitor_items, &ms->items, me1) {
|
||||||
if (me->type == MONITOR_SESSION)
|
if (me->type == MONITOR_SESSION)
|
||||||
monitor_check_session(ms, me, ft);
|
monitor_check_session(ms, me, ft);
|
||||||
@@ -427,7 +439,7 @@ monitor_check_all_panes(struct monitor_set *ms)
|
|||||||
ms->generation = 1;
|
ms->generation = 1;
|
||||||
RB_FOREACH(wl, winlinks, &s->windows) {
|
RB_FOREACH(wl, winlinks, &s->windows) {
|
||||||
TAILQ_FOREACH(wp, &wl->window->panes, entry) {
|
TAILQ_FOREACH(wp, &wl->window->panes, entry) {
|
||||||
ft = format_create_defaults(NULL, c, s, wl, wp);
|
ft = monitor_create_formats(c, s, wl, wp);
|
||||||
RB_FOREACH_SAFE(me, monitor_items, &ms->items, me1) {
|
RB_FOREACH_SAFE(me, monitor_items, &ms->items, me1) {
|
||||||
if (me->type != MONITOR_ALL_PANES)
|
if (me->type != MONITOR_ALL_PANES)
|
||||||
continue;
|
continue;
|
||||||
@@ -455,7 +467,7 @@ monitor_check_all_windows(struct monitor_set *ms)
|
|||||||
if (++ms->generation == 0)
|
if (++ms->generation == 0)
|
||||||
ms->generation = 1;
|
ms->generation = 1;
|
||||||
RB_FOREACH(wl, winlinks, &s->windows) {
|
RB_FOREACH(wl, winlinks, &s->windows) {
|
||||||
ft = format_create_defaults(NULL, c, s, wl, NULL);
|
ft = monitor_create_formats(c, s, wl, NULL);
|
||||||
RB_FOREACH_SAFE(me, monitor_items, &ms->items, me1) {
|
RB_FOREACH_SAFE(me, monitor_items, &ms->items, me1) {
|
||||||
if (me->type != MONITOR_ALL_WINDOWS)
|
if (me->type != MONITOR_ALL_WINDOWS)
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user