1
0
mirror of https://github.com/openbsd/src.git synced 2026-06-18 15:23:33 +02:00

Fix squash-groups skipping every session, GitHub issue 5180 from Bryce

Miller.
This commit is contained in:
nicm
2026-06-08 21:46:19 +00:00
parent fedd2d2215
commit cd1cface29
+5 -5
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: window-tree.c,v 1.78 2026/06/08 21:01:33 nicm Exp $ */
/* $OpenBSD: window-tree.c,v 1.79 2026/06/08 21:46:19 nicm Exp $ */
/*
* Copyright (c) 2017 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -355,6 +355,7 @@ window_tree_build(void *modedata, struct sort_criteria *sort_crit,
uint64_t *tag, const char *filter)
{
struct window_tree_modedata *data = modedata;
int squash_groups = data->squash_groups;
struct session *s, **l;
struct session_group *sg, *current;
u_int n, i;
@@ -370,15 +371,14 @@ window_tree_build(void *modedata, struct sort_criteria *sort_crit,
l = sort_get_sessions(&n, sort_crit);
if (n == 0)
return;
s = l[n - 1];
for (i = 0; i < n; i++) {
if (data->squash_groups &&
(sg = session_group_contains(s)) != NULL) {
s = l[i];
if (squash_groups && (sg = session_group_contains(s)) != NULL) {
if ((sg == current && s != data->fs.s) ||
(sg != current && s != TAILQ_FIRST(&sg->sessions)))
continue;
}
window_tree_build_session(l[i], modedata, sort_crit, filter);
window_tree_build_session(s, modedata, sort_crit, filter);
}
switch (data->type) {