4
votes

I've found TMUX's choose-tree command to be quite useful when navigating between sessions, but I dislike it only displaying inside of the current pane. I'd prefer it to overtake my entire screen.

Inside my tmux.conf I'm attempting to write something to do just that, but haven't quite figured it out:

# ~/.tmux.conf
bind-key a resize-pane -Z \; choose-tree

My trigger command Ctrl-a + a will zoom the current tmux pane to be fullscreen and run choose-tree inside of it. Unfortunately this leaves the pane zoomed in.

Any ideas how I can unzoom the pane afterwards, or a different approach for fullscreen TMUX session selection?

2

2 Answers

3
votes

With Tmux v2.7 zooming the pane for session-selection gets fairly simple, just add the -Z option

# ~/.tmux.conf bind-key a choose-tree -Z

2
votes

It's not very clear from the documentation, but you can use the -c parameter to execute a command when you choose the window.
In this way you can toggle back the pane and then switch to the selected window:

# ~/.tmux.conf
bind-key a resize-pane -Z \; choose-tree -u -c "resize-pane -Z \; select-window -t '%%'"

tmux v2.6 include a new implementation of the choose-tree command that does not support anymore -u and -c commands.
The new syntax for this version to achieve the same is:

# ~/.tmux.conf
bind-key a resize-pane -Z \; choose-tree "resize-pane -Z \; select-window -t '%%'"