Tmux is one of the most useful tool when it comes to using using a linux terminal.
Tmux is a terminal multiplexer, it allows a user to access multiple terminals (or windows), each running a separate program, while providing a single screen to work on. Tmux is useful for running more than one command-line program at the same time, increasing productivity and the way you work.
Join 2 tmux windows to one, creating 2 panes
Let's consider the case where you are inside your tmux window. Let's say you have 2 tmux windows - 1 and 2. When you want to merge the 2 windows, to merge all the panes together of these 2 windows, you can run the following command-
Prefix : join-pane -s 2 -t 1
By default the prefix is
Ctrl-B, so to merge tmux
window 2 to tmux
window 1 you can run the following command-
Ctrl-B : join-pane -s 2 -t 1
NOTE: You can also split the panes to multiple windows, this will help in organizing panes or separating them logically.
I hope you found this article useful, glad that you found it easy to merge 2 windows in tmux to a single tmux window. You can also check out the complete tmux cheatsheet of keyboard shortcuts and mouse shortcuts.