Skip to content

Instantly share code, notes, and snippets.

@ammar
Created August 17, 2017 15:13
Show Gist options
  • Save ammar/aa9fcae876477ca0f31d5208b756cca0 to your computer and use it in GitHub Desktop.
Save ammar/aa9fcae876477ca0f31d5208b756cca0 to your computer and use it in GitHub Desktop.
Tmux script to setup a tmate session (a rails app directory tree in this case)
#!/bin/bash
tmux_session=pair
tmux rename-session 'pair'
tmux rename-window 'shell'
tmux send-keys -t $session_name:1 'source .env' Enter
tmux new-window -t $tmux_session:2 -n 'root'
tmux send-keys -t $session_name:1 'source .env' Enter
cd ./app
tmux new-window -t $tmux_session:3 -n 'app'
cd ./views
tmux new-window -t $tmux_session:4 -n 'views'
cd ./../assets/stylesheets
tmux new-window -t $tmux_session:5 -n 'css'
cd ./../javascripts/
tmux new-window -t $tmux_session:6 -n 'js'
cd ./../../../log
tmux new-window -t $tmux_session:7 -n 'log'
cd ./../lib/tasks
tmux new-window -t $tmux_session:8 -n 'tasks'
cd ./../../
tmux new-window -t $tmux_session:9 -n 'console'
tmux select-window -t $tmux_session:2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment