tmuxで複数のペインに対して同時にコマンドを実行する

tmuxで複数のペインに対して同時にコマンドを実行する
https://qiita.com/mogulla3/items/fe2c13c23ec1bf266317



tmuxの詳細は知らないが、複数のサーバに同じコマンドを投げたい。
tmuxの起動後に、以下を実行するショートカットを登録した
・ペインを縦に分割する(Ctrl+2)
・ペインを横に分割する(Ctrl+_)
・ペインを移動する(Ctrl+←、↓、↑、→)
・ペインの幅を変更する(Ctrl+Shift+←、↓、↑、→)


synchronize-panes もショートカットでできるようにしたい。
以下のページにショートカット化、トグル化の方法が紹介されていた。
tmuxのsynchronize-panesをtoggle化する方法
https://qiita.com/waieneiaw/items/22ed18809739c9a69f25

僕は、Ctrl+s に割り当てましたよ

$ more .tmux.conf
bind -n C-@ split-window -h
bind -n C-_ split-window -v

bind -n C-left select-pane -L
bind -n C-down select-pane -D
bind -n C-up select-pane -U
bind -n C-right select-pane -R

bind -n C-S-left resize-pane -L 1
bind -n C-S-down resize-pane -D 1
bind -n C-S-up resize-pane -U 1
bind -n C-S-right resize-pane -R 1

bind -n C-s setw synchronize-panes \; display "synchronize-panes #{?pane_synchronized,on,off}"


その他、参照したURL:
tmuxで画面分割したり一斉にキー入力を送信したりする
https://blog.katty.in/1078


tmuxのプレフィックスに疲れたらbind -nオプションを使おう
https://blog.monochromegane.com/blog/2013/12/12/tmux-no-prefix/


Using Ctrl+[0-9] to cycle between windows using tmux
https://unix.stackexchange.com/questions/96884/using-ctrl0-9-to-cycle-between-windows-using-tmux


端末アプリで Ctrl-[ が Esc になる理由
https://tyru.hatenablog.com/entry/2018/10/04/151740