Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tmux: how to restore layout after changing it with select-layout or next-layout?

Tags:

terminal

tmux

After starting a new tmux session I usually open multiple panes in the default window, and then resize them manually using the resize-pane commands (through shortcuts of course).

After doing some work, I arrive at a point, or have a certain kind of output, that I want to quickly view side-by-side vertically or horizontally. So I use the select-layout or the next-layout commands.

However once I'm done with these views, I want to go back to the layout that I set up originally. Is there any command/procedure that can let me do that?

Not only do I seem to not be able to restore to my original layout, I can't seem to do that with manual resizing either.

like image 684
Yudle Joza Avatar asked Mar 21 '14 18:03

Yudle Joza


People also ask

How do you undo in tmux?

Tmux has gained this functionality now as of v2. 1 (see CHANGES): * 'select-layout' understands '-o' to undo the last layout change.

How do I change the layout on tmux?

To change the layout of panes in a Tmux windows, press <prefix><space> . It will change between different layouts. We may also use command select-layout (or selectl for short) instead. Possible layouts are: even-horizontal , even-vertical , main-horizontal , main-vertical , tiled .

What is Ctrl-B in tmux?

ctrl-b, <arrow key> switch to the pane in whichever direction you press. ctrl-b, d. detach from tmux, leaving everything running in the background.


1 Answers

Tmux has gained this functionality now as of v2.1 (see CHANGES):

* 'select-layout' understands '-o' to undo the last layout change.

like image 66
sjbx Avatar answered Sep 18 '22 17:09

sjbx