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
| Flag | Description |
|---|---|
| -r | Renumber windows in the session (close index gaps) |
| -a | Move to the index after dst-window |
| -b | Move to the index before dst-window |
| -d | Don't make the moved window current |
| -s src-window | Source window |
| -t dst-window | Destination window/index |
Examples
Move window 3 to index 1
bash
tmux move-window -s 3 -t 1Renumber windows to remove gaps
bash
tmux movew -rMove window 1 from session 'other'
bash
tmux movew -s other:1 -t 0Default 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