Skip to main content
Back to Commands
Window ManagementN/A (e.g. bind . command-prompt 'move-window -t %%')

move-window

Short form: movew

Move a window to a new index, optionally in another session. With -r, renumber all windows in the session to remove gaps in the indexes.

Synopsis

bash
tmux move-window [-abrdk] [-s src-window] [-t dst-window]

Options

FlagDescription
-rRenumber windows in the session (close index gaps)
-aMove to the index after dst-window
-bMove to the index before dst-window
-dDon't make the moved window current
-s src-windowSource window
-t dst-windowDestination window/index

Examples

Move window 3 to index 1

bash
tmux move-window -s 3 -t 1

Renumber windows to remove gaps

bash
tmux movew -r

Move window 1 from session 'other'

bash
tmux movew -s other:1 -t 0

Default Keybinding

N/A (e.g. bind . command-prompt 'move-window -t %%')

Default prefix is Ctrl+b

Pro Tips

  • set -g renumber-windows on keeps indexes gap-free automatically
  • Run move-window -r once to tidy existing gaps