Tmux as a ClusterSSH alternative

submited by
Style Pass
2024-10-10 14:00:04

A neat feature of tmux is that is supports multi-pane synchronized input via the set-option synchronize-panes 1 command. This allows you to enter input across all panes simultaneously.

While there are other tmux cluster bash scripts, they focus on trying to replicate ClusterSSH closely instead of being a generic 'open tmux with this many panes and this command.' script. Sometimes you want to sync other things than just ssh. One useful task I used the x11 based ClusterSSH for was opening several ssh to localhost windows and opening a seperate JSON log file in each. This was very handy for debugging having scroll synced across each file. Tmux makes this easier and now with the script below it's as simple as calling it with the commands you want for each pane. Plus it no longer needs an x11 terminal. So using it on a wayland only setup or even over ssh works well too.

Below is a small bash script and some examples showing how you can use synchronized input on tmux, including commands to disable input on certain panes, plus running nested tmux.

Leave a Comment