Tmux: How to join two tmux windows into one, as panes


I have two tmux windows, with a single pane in each, and I would like to join these two panes together into a single window as a horizontal split panes. How could I do that?

Best Solution

Actually I found the way to do that. Suppose the two windows are number 1 and 2. Use

join-pane -s 2 -t 1 

This will move the 2nd window as a pane to the 1st window. The opposite command is break-pane