-
-
Save L3viathan/b1c9c2c3bc20dfa3b5cab61e261a52dc to your computer and use it in GitHub Desktop.
Start a tmux pane for each of the specified hosts, in synchronized-panes mode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if (( $# > 6 )); then | |
layout=tiled | |
else | |
layout=even-vertical | |
fi | |
hosts=( "$@" ) | |
tmux new-window | |
tmux send-keys "ssh ${hosts[0]}" | |
for i in $(seq 1 $((${#hosts[@]} - 1))) | |
do | |
tmux split-window | |
tmux send-keys "ssh ${hosts[$i]}" | |
tmux select-layout $layout | |
done | |
tmux setw synchronize-panes | |
tmux send-keys Enter |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment