After 13 years of using GNU Screen now moving to tmux.
( from https://centos.pkgs.org/7/ius-x86_64/tmux2u-2.5-1.ius.centos7.x86_64.rpm.html )
rpm -Uvh https://centos7.iuscommunity.org/ius-release.rpm
yum install tmux2u
tmux -L work
#!/bin/bash
tmux has-session -t work
if [ $? != 0 ]; then
tmux new-session -s work -n kube -d
tmux send-keys -t work 'ssh k8sm-01' C-m
tmux split-window -h -t work
tmux send-keys -t work:1.2 'ssh k8sn-01' C-m
tmux split-window -v -t work
tmux send-keys -t work:1.3 'ssh k8sn-02' C-m
tmux new-window -n console -t work
tmux send-keys -t work:2 'cd;pwd' C-m
tmux select-window -t work:1.1
fi
tmux attach -t work
Press the control key
setw synchronize-panes on
If you type anything in one pane, same command will run on other pane also.
setw synchronize-panes off