Files
CodeSnippets/tmux/input_sync
2022-08-12 13:08:32 +09:30

15 lines
569 B
Plaintext

# Example of a function you could place in .bashrc (or similar) showing synchronised input to multiple panes in tmux.
function multi_ssh
{
tmux new-session \; \
split-window -h \; \
select-pane -t 0 \; \
send-keys 'ssh user1@server1' C-m \; \
select-pane -t 1 \; \
send-keys 'ssh user2@server2' C-m \; \
setw synchronize-panes \;
}
# This will give two panes, each one ssh'd into a different server (we've assumed keys setup for auth), and with anything
# you now type being entered into BOTH panes simultaneously.