Skip to main content
Back to Commands
Pane ManagementPrefix + { or } to swap

swap-pane

Short form: swapp

Swap two panes. If -U is given, swap with the previous pane; if -D, swap with the next pane.

Synopsis

bash
tmux swap-pane [-dDUZ] [-s src-pane] [-t dst-pane]

Options

FlagDescription
-DSwap with the next pane
-USwap with the previous pane
-dDon't change active pane
-s src-paneSpecify source pane
-t dst-paneSpecify destination pane

Examples

Swap with next pane

bash
tmux swap-pane -D

Swap with previous pane

bash
tmux swap-pane -U

Swap pane 1 and pane 2

bash
tmux swapp -s 1 -t 2

Default Keybinding

Prefix + { or } to swap

Default prefix is Ctrl+b

Pro Tips

  • Prefix + { swaps with previous pane, } with next
  • Useful for rearranging your layout