Reorder windows in tmux

To reorder windows in tmux, you can use following command

CTRL + B + .

Press CTRL + B or whatever prefix you use, then press . (dot). This will ask you number/position where you need current window moved.

Another method is

CTRL + B + :

This will give you tmux command promt. Now enter

move-window -t 0

This will move current window to position 0. This only work if position 0 is empty. If another window already present in position 0, use swap-window command.

swap-window -t 0

This with swap current window with window in position 0.

Another useful command is

CTRL + B + ,

This will allow you to rename current tmux window.

Using shortcuts

You can edit .tmux.conf file and add following

bind-key -n C-S-Left swap-window -t -1
bind-key -n C-S-Right swap-window -t +1

Now you can use CTRL + SHIFT + LEFT OR RIGHT arrow to move windows.

See tmux

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *