Adjusting screen split pane sizes in tmux

I'd like to resize the panes so I can expand / compress the pane sizes (up / down / left / right etc) ..

Any way to get this done?


Assuming your prefix key is still the default of CtrlB
To resize down, use: CtrlB:resize-p -D 2
To resize up, use: CtrlB:resize-p -U 2
To resize left, use: CtrlB:resize-p -L 2
To resize right, use: CtrlB:resize-p -R 2

So, this means to first hold Ctrl, then press and release B, then release B, then type a colon (:, which is typically typed by holding Shift and pressing semi-colon ;), then type the word resize and the rest. Those horizontal lines are common hyphens/dashes/minus-signs. At the end of the line, issue a "newline" (pressing Enter or Return depending on what is on the keyboard).

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.

Update: I've certainly appreciated this question. It continues to get upvotes years after being initially posted.

The information I provided above should work in a wide variety of circumstances. For instance, it works when using SSH to control a remote machine that uses OpenBSD which has tmux built-in.

There are some other techniques that some people have found work well for them, and those techniques may use fewer keystrokes. In particular, it seems like tmux has become built-in on Macs and people have had some success with holding down one or more keys. Such techniques are not as likely to work in as wide of a variety of scenarios (such as when using different types of computers/operating systems, and possibly remote terminals), but in some environments an alternate method may be a faster way than what is described by these instructions.

This answer has generated a few comments below that describe some alternates that have worked for other people. If you just want to get the job done with a reliable method, I suggest following the instructions near the top of this answer. If you want to read even further to see about potentially faster methods, make sure to take the time to review comments under this answer because information there has clearly worked well for people too.


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.


I just added the following lines to my tmux.conf file

bind j resize-pane -D 10
bind k resize-pane -U 10
bind l resize-pane -L 10
bind h resize-pane -R 10

and now I can use Ctrl-a (my prefix key) with [h|j|k|l] to resize the panes