From 519f63d8494b749e45c46674301dda6a4f6b8230 Mon Sep 17 00:00:00 2001 From: daryl Date: Fri, 12 Aug 2022 13:08:32 +0930 Subject: [PATCH] Add 'tmux/input_sync' --- tmux/input_sync | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tmux/input_sync diff --git a/tmux/input_sync b/tmux/input_sync new file mode 100644 index 0000000..9d0d53e --- /dev/null +++ b/tmux/input_sync @@ -0,0 +1,15 @@ +# 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. \ No newline at end of file