From 6967f547745547149ec9460a073601e1e6789391 Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 3 Jul 2026 15:35:51 +0000 Subject: [PATCH] Add additional pane sort orders. --- format.c | 6 ++++++ tmux.1 | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/format.c b/format.c index dd6961b95..337fe18ec 100644 --- a/format.c +++ b/format.c @@ -5426,6 +5426,12 @@ format_replace(struct format_expand_state *es, const char *key, size_t keylen, sc->reversed = 0; break; } + if (strchr(fm->argv[0], 'i') != NULL) + sc->order = SORT_INDEX; + else if (strchr(fm->argv[0], 'z') != NULL) + sc->order = SORT_Z; + else + sc->order = SORT_CREATION; if (strchr(fm->argv[0], 'r') != NULL) sc->reversed = 1; else diff --git a/tmux.1 b/tmux.1 index 83c6bf042..def0780b8 100644 --- a/tmux.1 +++ b/tmux.1 @@ -6856,7 +6856,13 @@ to sort in reverse order. .Ql /r\& can also be used with .Ql P:\& -to reverse the sort order by pane index. +to reverse the sort order; by default panes are sorted by creation order. +.Ql P:\& +can also take +.Ql /i\& +to sort by pane index or +.Ql /z\& +to sort by z-index. For example, .Ql S/nr:\& to sort sessions by name in reverse order.