Skip to content

Instantly share code, notes, and snippets.

@mannih
Created February 18, 2016 14:10
Show Gist options
  • Save mannih/1ca4977f633b73237315 to your computer and use it in GitHub Desktop.
Save mannih/1ca4977f633b73237315 to your computer and use it in GitHub Desktop.
multissh with tmux
multissh() {
local hosts=( $* )
local win=$( tmux new-window -dP "ssh ${hosts[0]}" )
unset hosts[0]
for i in "${hosts[@]}"; do
tmux split-window -ht$win "ssh $i"
tmux select-layout -t$win tiled > /dev/null
done
tmux select-pane -t $win
tmux set-window-option -t $win synchronize-panes on > /dev/null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment