Skip to content

Instantly share code, notes, and snippets.

Created December 5, 2010 07:00
Show Gist options
  • Save swaroopch/728896 to your computer and use it in GitHub Desktop.
Save swaroopch/728896 to your computer and use it in GitHub Desktop.
A command that scripts a tmux session
function flask-boilerplate-tmux
cd $BASE
tmux start-server
tmux new-session -d -s flaskboilerplate -n model
tmux new-window -t flaskboilerplate:2 -n controller
tmux new-window -t flaskboilerplate:3 -n view
tmux new-window -t flaskboilerplate:4 -n console
tmux new-window -t flaskboilerplate:5 -n tests
tmux new-window -t flaskboilerplate:6 -n git
tmux send-keys -t flaskboilerplate:1 "cd $BASE/flask_application; vim" C-m
tmux send-keys -t flaskboilerplate:2 "cd $BASE/flask_application/controllers; ls" C-m
tmux send-keys -t flaskboilerplate:3 "cd $BASE/flask_application/templates; ls" C-m
tmux send-keys -t flaskboilerplate:4 "bpython -i" C-m
tmux send-keys -t flaskboilerplate:5 "python" C-m
tmux send-keys -t flaskboilerplate:6 "git status" C-m
tmux select-window -t flaskboilerplate:1
tmux attach-session -t flaskboilerplate
Copy link

btbytes commented Dec 6, 2010

looks interesting...
what does this do?
the resulting screenshot will be nice to see :)

Copy link

Copy link

Thank you! I never even noticed send-keys before.

Copy link

Very nice. Note to others, if you have "set -g base-index 0" which I think is the default, the windows start at 0, not 1.

Copy link

this is great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment