0

When I press Ctrl+b, W, tmux shows the list of all current windows and their panes as a tree. The problem is that this is very long when using many windows. I can collapse a window in the list by pressing Left, such that the list only shows the window but not its panes. This makes is easier to get an overview of available windows, but takes time since I need to collapse the list items one by one. How can I configure tmux to show all windows in collapsed view by default?

0

Prefix+w runs choose-tree -Zw. From tmux(1):

choose-tree [-GNswZ ] [-F format ] [-f filter ] [-O sort-order ] [-t target-pane ] [template ]

Put a pane into tree mode, where a session, window or pane may be chosen interactively from a list. -s starts with sessions collapsed and -w with windows collapsed. -Z zooms the pane.

So with default settings, the windows are already collapsed (ie. you can't see individual panes in the initial view).

If you want the initial view to be collapsed further, you could rebind it to use -s, so that each session only gets one line.

bind-key 'w' choose-tree -Zs

The -Z flag was introduced in tmux 2.7. If you're using version 2.6, the binding was simply choose-tree -w, so you should change it to choose-tree -s.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.