Skip to main content
Back to Commands
Window ManagementN/A (bind to a key)

swap-window

Short form: swapw

Swap two windows so they exchange positions. With -d the active window is not changed to follow the move.

Synopsis

bash
tmux swap-window [-d] [-s src-window] [-t dst-window]

Options

FlagDescription
-dDon't make the swapped window the current window
-s src-windowSource window
-t dst-windowDestination window

Examples

Swap window 2 with window 1

bash
tmux swap-window -s 2 -t 1

Swap current window with window 0, stay put

bash
tmux swapw -d -t 0

Default Keybinding

N/A (bind to a key)

Default prefix is Ctrl+b

Pro Tips

  • Combine with -d to reorder windows without following the move
  • Use move-window to renumber rather than swap