Skip to content

Instantly share code, notes, and snippets.

@willywos
Last active October 7, 2016 21:53
Show Gist options
  • Save willywos/4912a2468efe2b77a7cb4b69313109b5 to your computer and use it in GitHub Desktop.
Save willywos/4912a2468efe2b77a7cb4b69313109b5 to your computer and use it in GitHub Desktop.
A .tmux.sh example
#!/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