Last active
October 7, 2016 21:53
-
-
Save willywos/4912a2468efe2b77a7cb4b69313109b5 to your computer and use it in GitHub Desktop.
A .tmux.sh example
This file contains 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/sh | |
SESSION_NAME="%TMUX_SESSION_NAME%" | |
cd %CURRENT_DIRECTORY% | |
export TERM=screen-256color-bce tmux | |
tmux has-session -t ${SESSION_NAME} | |
if [ $? != 0 ] | |
then | |
tmux new-session -s ${SESSION_NAME} -n server -d | |
tmux send-keys -t ${SESSION_NAME} 'ls -a -l' C-m | |
sleep 2 | |
tmux split-window -v | |
tmux select-pane -L | |
tmux send-keys -t ${SESSION_NAME}:1 'git status' C-m | |
= | |
# Start out on the first window when we attach | |
tmux select-window -t ${SESSION_NAME}:1 | |
fi | |
tmux attach -t ${SESSION_NAME} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment