How to add a horizontal split to tmux window that spans the whole width of the parent window?

You can use one of the five preset layout modes (tiled) to achieve this. From your starting point (a single vertical split), open a new pane, which by default will split the active pane and then arrange the panes into tiled mode:

Ctrlb,Alt5

From man tmux:

M-1 to M-5    Arrange panes in one of the five preset layouts: even-horizontal,even-vertical, main-horizontal, main-vertical, or tiled.

You could optionally add a select-layout tiled to a keybind in your .tmux.conf if this was a layout you wanted regularly.


Get a newer version of tmux (at least 2.3).

From the man page:

The -f option creates a new pane spanning the full window height (with -h) or full window width (with -v), instead of splitting the active pane.


tmux 2.3 supports the -f switch in split-window which does exactly what you are looking for (check man here):

The -f option creates a new pane spanning the full window height (with -h) or full window width (with -v), instead of splitting the active pane.

For example, in your case:

1) ctrl-b %

+–––––––––+–––––––––+
|         |         |
|         |         |
|         |         |  
|         |         |
|         |         |
|         |         |
|         |         |
|         |         |
+–––––––––––––––––––+

2) ctrl-b :splitw -fv

Note that after ctrl-b :, you will be typing in the tmux command-prompt (look at the bottom bar).

+–––––––––+–––––––––+
|         |         |
|         |         |
|         |         |  
|         |         |
+–––––––––+–––––––––+
|                   |
|                   |
|                   |
+–––––––––––––––––––+

Tags:

Tmux