332

After doing join-pane on 2 windows, you have 2 horizontal panes. How do I rearrange the panes to be vertical panes instead?

4 Answers 4

468

C-b space (bound to next-layout by default) cycles through available layouts, you can also use the select-layout command.

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

On OS X, M is Esc, i.e. Ctrl-b Esc-1.

See man tmux for more details.

4
  • 4
    Yup, that worked, C-b M-1 worked for me Commented Oct 29, 2012 at 17:47
  • 12
    On Linux, Meta => Alt key, so Ctrl-b + Alt-<1-5> does the work.
    – 0xF1
    Commented Dec 20, 2019 at 8:32
  • 4
    If all of above is not working for you, try C-b <Space>
    – user81635
    Commented Nov 1, 2021 at 23:51
  • C-b <Space> is the only thing that worked for me indeed Commented Oct 25, 2022 at 10:57
18

In Mac OS Yosemite, this works:

Prefix + Option-[1-5]

e.g: Ctrl-b Option-1

1
  • on my mac with iTerm2, this translates to Control-b ESC 1 Commented Oct 16, 2022 at 19:21
14

You should be able to use:

ctrl-b meta-2

to do this, but I'm unable to test it since OS X doesn't like anything too "meta" (we have at least that in common).

Source: http://hyperpolyglot.org/multiplexers

1
  • 10
    You should be able to configure your terminal emulator with “option as meta“ (Terminal) or “option as +Esc“ (iTerm2), but you can always type C-b M-2 manually as C-b ESC 2. Commented Oct 26, 2012 at 8:20
2

There are also an options for explicitly requiring the join/split to happen vertically/horizontally: -h and -v

(see man page and note that the -h/-v do not refer to the direction of the separator line).

3
  • how does tmux swap two pane?
    – CS QGB
    Commented Aug 30, 2022 at 7:13
  • With the swap-pane command.
    – peterph
    Commented Sep 1, 2022 at 22:32
  • or use C-b space
    – CS QGB
    Commented Sep 1, 2022 at 22:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .