Add a nicer default second and third status line, from Michael Grant in

GitHub 4490.
This commit is contained in:
nicm
2025-08-14 07:15:40 +00:00
parent 0646814235
commit 1370791734
5 changed files with 133 additions and 15 deletions

View File

@ -4417,14 +4417,14 @@ format_loop_sessions(struct format_expand_state *es, const char *fmt)
l = xreallocarray(l, lsz, sizeof *l);
}
l[n++] = s;
}
}
qsort(l, n, sizeof *l, format_cmp_session);
qsort(l, n, sizeof *l, format_cmp_session);
value = xcalloc(1, 1);
valuelen = 1;
for (i = 0; i < n; i++) {
for (i = 0; i < n; i++) {
s = l[i];
format_log(es, "session loop: $%u", s->id);
if (active != NULL && s->id == ft->c->session->id)
@ -4542,7 +4542,7 @@ format_loop_windows(struct format_expand_state *es, const char *fmt)
l = xreallocarray(l, lsz, sizeof *l);
}
l[n++] = wl;
}
}
if (sc->field != FORMAT_LOOP_BY_INDEX)
qsort(l, n, sizeof *l, format_cmp_window);
@ -4641,9 +4641,9 @@ format_loop_panes(struct format_expand_state *es, const char *fmt)
l = xreallocarray(l, lsz, sizeof *l);
}
l[n++] = wp;
}
}
qsort(l, n, sizeof *l, format_cmp_pane);
qsort(l, n, sizeof *l, format_cmp_pane);
value = xcalloc(1, 1);
valuelen = 1;
@ -4737,7 +4737,7 @@ format_loop_clients(struct format_expand_state *es, const char *fmt)
l = xreallocarray(l, lsz, sizeof *l);
}
l[n++] = c;
}
}
if (sc->field != FORMAT_LOOP_BY_INDEX)
qsort(l, n, sizeof *l, format_cmp_client);
@ -4752,7 +4752,7 @@ format_loop_clients(struct format_expand_state *es, const char *fmt)
}
}
for (i = 0; i < n; i++) {
for (i = 0; i < n; i++) {
c = l[i];
format_log(es, "client loop: %s", c->name);
if (i == n - 1)