Guide
Using tmux synchronize-panes to run identical commands across multiple panes
Learn how to enable tmux's synchronize-panes option to mirror keystrokes across panes, with a worked example, limits, and common pitfalls.
Published by Tasadduq Burney
07 Aug 2026, 16:56 UTC
2 min20.5K views0

Quick answer
Enable tmux's synchronize-panes option so that every keystroke you type in the active pane is sent to all other panes in the same window. This lets you run identical commands on multiple servers or environments without retyping.
How synchronize-panes works
The option is window‑scoped. When it is set to on, tmux forwards each key press from the focused pane to every other pane in that window. It does not copy output, scrollback, or pane‑specific settings.
Worked configuration example
- Start a tmux session (or attach to an existing one).
- Split the window into three panes: press
Ctrl+bthen"(horizontal split) followed byCtrl+bthen%(vertical split) to obtain three panes. - Enable synchronization for the current window: press
Ctrl+b, type:set-window-option synchronize-panes on, and hitEnter. - Now type a command in any pane, for example
ls -l. The same keystrokes appear in the other two panes and are executed there as well.
# To make the behavior default for new windows, add to ~/.tmux.conf\nset-window-option synchronize-panes on\nLimits and common mistakes
- Only keystrokes are mirrored; output, scrollback, pane titles, and layouts stay independent.
- The setting applies to the current window only. Opening a new window or session does not inherit it unless you set it in your config.
- Leaving synchronization on can cause destructive actions: editing a file in one pane will send the same edit commands to all panes, potentially corrupting multiple files.
- To disable, press
Ctrl+b, type:set-window-option synchronize-panes off, and hitEnteror remove the option from your config. - Check the current state with
Ctrl+bthen:show-window-option synchronize-panesandEnter; tmux will displayonoroff.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.