Created
June 4, 2012 15:05
-
-
Save jamesog/2868925 to your computer and use it in GitHub Desktop.
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
if tmux has 2>/dev/null; then | |
echo "tmux sessions found:" | |
tmux ls | |
echo | |
echo -n "Attaching to default tmux session in 5 seconds. Press Ctrl-C to abort" | |
for ((i=5; i>0; i--)) | |
do | |
printf "." | |
if read -s -t 1 -k ; then break; fi | |
done | |
tmux attach | |
else | |
echo -n "Starting new tmux session in 3 seconds (Ctrl-C to abort)." | |
sleep 3 | |
tmux new | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment