Skip to content

Instantly share code, notes, and snippets.

@d6rkaiz
Created September 4, 2013 10:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save d6rkaiz/6435320 to your computer and use it in GitHub Desktop.
Save d6rkaiz/6435320 to your computer and use it in GitHub Desktop.
tmuxでセッションの有無を判別して起動するスクリプト ref: http://qiita.com/d6rkaiz/items/993ef586aa39f2ddb588
#!/bin/bash
tmux ls > /dev/null
if [ $? -eq 1 -a -z "$TMUX" ]; then
exec tmux
elif [ -z "$TMUX" ] ; then
exec tmux attach
else
echo "sessions should be nested with care."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment