Kill all tmux windows except one

Much like killing panes1, use kill-window to kill all windows except the current one:

kill-window -a

To kill all windows except for a specific one, use the -t flag:

kill-window -a -t 0

  1. :

    https://unix.stackexchange.com/a/15452:

    kill-pane -a -t 0
    
    ↩︎