mirroring a pane between two windows

I'm afraid this is one of the things you can't do with tmux (I would expect the problems with one pane being displayed in several spaces of different sizes to be the main reason). However, there are several ways you can work around that - all based on binding certain actions to some key combinations. Since a lot depends on the layout you are using, having just a simple layout with two panes you are mentioning is making your life much easier

  1. rotate-window - it will just swap the panes, thus giving you 80%-90% for command output (and the small window for ViM).

  2. break-pane vs. join-pane -v -p <preview_percentage> -t !

  3. pipe-pane with command being unbuffered redirection to a named pipe (i.e. a file system node created with mkfifo) - then use tail -f that named pipe in the other pane.

  4. pipe the output to less, which also has the follow mode that tail has (at least the GNU one).

  5. resize-pane -Z on the smaller panel will zoom it on full terminal. Subsequent un-zoom will keep it active so a little bit trickery is needed to make it work comfortably.


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.


I agree with others that for your case Prefix + z would be the most direct solution, but for the general question of mirroring a pane there's a bit of a hack that could work - nesting a screen session inside tmux.

Install gnu screen, then start it up for the pane you want to mirror. Then screen -x to attach in other panes.

You could also nest another tmux session in the pane if you wanted to, but tmux sessions should be nested with care.

Tags:

Tmux