Created
February 3, 2016 17:45
-
-
Save timonv/97712de7e78cc6532183 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
function c() { | |
if [[ -n $(tmux list-sessions | awk '{print $1}' | grep $1) ]]; then | |
tmux switch-client -t $1 | |
elif [[ -n $TMUX ]]; then | |
tmux switch-client -t "$(TMUX= tmux -S "${TMUX%,*,*}" new-session -dPs "$1")" | |
else | |
tmux new-session -s "$1" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment