Mirroring a pane between two windows

tmux

Is it possible to have the same pane appear in two different windows of a single tmux session?

I typically have a single horizontal split in my main window with vim in the top pane (about 80-90% of the terminal height), and a command line in the bottom pane where I run the program I'm working on. Because the bottom window is so small, I often can't see error output, and using tmux's keyboard shortcuts to scroll back is getting tiresome. I'd like to have my second window attach to the same pane so that if I need to see more of my error output, I can just quickly switch to the second window without needing to deal with scrollback. Is this possible?

(I guess one fallback would be to use something like tee to write stdout to a log file and tail that in my second window. I'm hoping that's not necessary though)

Best Answer

By default, you can toggle a pane's "zoom state" by pressing Prefix and z (the default prefix is Ctrl+B).

This will make the current pane (your command line pane, for example) occupy the whole window. Press Prefix and z again to "unzoom" the pane.

Related Question