Synchronize Panes in Tmux

Tmux is an alternative for screen. For anyone who doesn't know screen, it is a terminal multiplexer which means, it allow multiple windows in terminal. It can split your window into multiple panes (vertical/horizontal), detach a session which can be attached at a later time. Detach/Attach is very useful for running a job in a remote server without having to keep the ssh open the whole time. 

Tmux can be configured by  ~/.tmux.conf file.
My prefix key is Ctrl-q.
Synchronizing panes:
If you want to send your keystrokes to all the panes in your tmux window: 
<prefix> :setw synchronize-panes
In my case I do:
Ctrl-q:setw synchronize-panes
This is immensely useful if you want to execute the same set of commands on multiple servers.

Comments

Nice! Now how do I turn it off? =)
@isnoop: That option is a toggle. So to turn it off just do

<prefix> :setw synchronize-panes

That should turn it off. :)
Hi. A colleague of mine mentioned that feature. For me this comes in really handy when working on two or more identical files located on different servers. Saves me a lot of time and avoids headaches about files. being out of sync. Thanks for sharing!

Add a comment