public
Created

Simple shell script that wraps tmux to simulate clusterssh behaviour, while not needing X and having all the advantages of tmux. Run as: ./uberssh.sh my_session_name host1 host2 host3 To toggle between input synchronization, use "ctrl+b u".

  • Download Gist
ubserssh.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#!/bin/bash
TMUX_PATH="/usr/bin/tmux"
SESS_NAME="$1"
shift
 
HOSTS="$*"
let ctr=0
for h in $HOSTS; do
if [ $ctr -eq 0 ]; then
$TMUX_PATH new-session -d -s $SESS_NAME "ssh $h"
else
$TMUX_PATH splitw -t $SESS_NAME:0 "ssh $h"
$TMUX_PATH select-layout -t $SESS_NAME:0 tiled
fi
let ctr=ctr+1
done
$TMUX_PATH set-window-option -t $SESS_NAME:0 synchronize-panes on
$TMUX_PATH select-pane -t $SESS_NAME:0
$TMUX_PATH bind-key u set-window-option synchronize-panes
$TMUX_PATH attach -t $SESS_NAME

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.