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
Alternatively, if you don’t want to specify the window names when calling
join-pane, you can also mark the pane you want to join into the current window.
Let’s say you want to move a pane from window 2 to window 1. Here’s how to do it:
- Switch to window 2.
- Mark the desired pane with Prefixm.
- Switch to window 1.