Adjusting screen split pane sizes in tmux

Assuming your prefix key is still the default of Ctrl-B
^B :resize-p -D 2
^B :resize-p -U 2
^B :resize-p -L 2
^B :resize-p -R 2
The numbers at the end are optional, defaulting to 1. The -U is also a default, and is unnecessary.

If you ever forget that, ^B ? will show these found to C-Up and C-Down and C-Left and C-Right, at the end of the keys (with the default key bindings).

You could also try pressing Ctrl+B followed by a Ctrl+arrow-keys.
However, note that Ctrl-arrow-keys may be problematic on some terminals. So you can either try to address the terminal limitations, or create new shortcut key bindings, or just not use shortcuts and use the longer commands shown above.


One option for resizing panes is to use the mouse. To do this, add these lines to your .tmux.conf:

set -g mode-mouse on
set -g mouse-resize-pane on

If you are on a Mac and the above doesn't work, use this instead (source):

set-option -g mouse on

Once this mode is on, simply click and drag on pane dividers to resize them.


Assuming your prefix key is Ctrl-B (Cmd-B on Mac):

  1. Press Ctrl-B and release
  2. Press and hold Meta (Option on Mac)
  3. While holding Meta press arrow keys repeatedly to resize current pane

It seems however that there is some timeout so if you don't press an arrow key while holding Meta within 1 or 2 seconds Meta-{arrow} will be considered as an input in current prompt.

Tags:

Macos

Tmux