mirror of
https://github.com/tmux/tmux.git
synced 2026-09-21 12:28:14 +00:00
format: fix session_bell/activity/silence_flag only checking one winlink
format_cb_session_bell_flag() and its activity/silence siblings had their "not set" return inside the RB_FOREACH loop, so they only ever examined the first winlink in tree order and returned immediately regardless of its state - never checking any other window in the session. The silence variant also read ft->wl (the display target) instead of the loop variable, so it ignored the window it was even supposed to be looking at. Move the "not set" return after the loop so every winlink is checked, and use the loop variable throughout. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
10
format.c
10
format.c
@@ -2876,10 +2876,10 @@ format_cb_session_activity_flag(struct format_tree *ft)
|
||||
|
||||
if (ft->s != NULL) {
|
||||
RB_FOREACH(wl, winlinks, &ft->s->windows) {
|
||||
if (ft->wl->flags & WINLINK_ACTIVITY)
|
||||
if (wl->flags & WINLINK_ACTIVITY)
|
||||
return (xstrdup("1"));
|
||||
return (xstrdup("0"));
|
||||
}
|
||||
return (xstrdup("0"));
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
@@ -2894,8 +2894,8 @@ format_cb_session_bell_flag(struct format_tree *ft)
|
||||
RB_FOREACH(wl, winlinks, &ft->s->windows) {
|
||||
if (wl->flags & WINLINK_BELL)
|
||||
return (xstrdup("1"));
|
||||
return (xstrdup("0"));
|
||||
}
|
||||
return (xstrdup("0"));
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
@@ -2908,10 +2908,10 @@ format_cb_session_silence_flag(struct format_tree *ft)
|
||||
|
||||
if (ft->s != NULL) {
|
||||
RB_FOREACH(wl, winlinks, &ft->s->windows) {
|
||||
if (ft->wl->flags & WINLINK_SILENCE)
|
||||
if (wl->flags & WINLINK_SILENCE)
|
||||
return (xstrdup("1"));
|
||||
return (xstrdup("0"));
|
||||
}
|
||||
return (xstrdup("0"));
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user