When rendering the tree, it perhaps doesn't make sense to show panes
where there's only one in a window, since selecting this pane won't mean
much; likewise, operating on the window should suffice in this case.
---
 window-tree.c | 32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/window-tree.c b/window-tree.c
index 1ea1256e..29baaed6 100644
--- a/window-tree.c
+++ b/window-tree.c
@@ -260,23 +260,27 @@ window_tree_build_window(struct session *s, struct 
winlink *wl, void* modedata,
 
        l = NULL;
        n = 0;
-       TAILQ_FOREACH(wp, &wl->window->panes, entry) {
-               if (filter != NULL) {
-                       cp = format_single(NULL, filter, NULL, s, wl, wp);
-                       if (!format_true(cp)) {
+
+       if (window_count_panes(wl->window) > 1) {
+               TAILQ_FOREACH(wp, &wl->window->panes, entry) {
+                       if (filter != NULL) {
+                               cp = format_single(NULL, filter, NULL, s, wl,
+                                   wp);
+                               if (!format_true(cp)) {
+                                       free(cp);
+                                       continue;
+                               }
                                free(cp);
-                               continue;
                        }
-                       free(cp);
+                       l = xreallocarray(l, n + 1, sizeof *l);
+                       l[n++] = wp;
+               }
+               if (n == 0) {
+                       window_tree_free_item(item);
+                       data->item_size--;
+                       mode_tree_remove(data->data, mti);
+                       return (0);
                }
-               l = xreallocarray(l, n + 1, sizeof *l);
-               l[n++] = wp;
-       }
-       if (n == 0) {
-               window_tree_free_item(item);
-               data->item_size--;
-               mode_tree_remove(data->data, mti);
-               return (0);
        }
 
        switch (sort_type) {
-- 
2.13.2

-- 
You received this message because you are subscribed to the Google Groups 
"tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to