-
-
Save vitaly/7117079 to your computer and use it in GitHub Desktop.
Run the command in x tmux splits. e.g. `bash x 4 iex` will run `iex` in 4 spilts in tmux
This file contains hidden or 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 -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
I have tried this but getting following error -
sessions should be nested with care, unset $TMUX to forceI have windows, with cygwin.