Skip to content

Instantly share code, notes, and snippets.

@nivertech
Forked from vitaly/x
Created November 5, 2013 18:49
Show Gist options
  • Select an option

  • Save nivertech/7323995 to your computer and use it in GitHub Desktop.

Select an option

Save nivertech/7323995 to your computer and use it in GitHub Desktop.
#!/bin/bash -x
N=$1; shift
if [ -z "$N" -o -z "$1" ]; then
cat <<_
Usage: $0 N COMMAND
_
exit 1
fi
S=s$$
tmux new-session -d -s $S "$*"
# we start from 2 because we already have 1 pane
for i in `seq 2 $N`; do
tmux split-window -h -t $S "$*"
tmux select-layout tiled
done
tmux select-pane -t .0
tmux at -t $S
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment