Skip to content

Instantly share code, notes, and snippets.

@ctcherry
Last active May 23, 2018 20:51
Show Gist options
  • Save ctcherry/db5891f2e2307354e1576ec54b84de16 to your computer and use it in GitHub Desktop.
Save ctcherry/db5891f2e2307354e1576ec54b84de16 to your computer and use it in GitHub Desktop.
shell function to make a new tmux session named after the current directory name, and switch to it. mnemonic: make session
mks() {
sname=$(basename ${PWD//./-})
tmux has-session -t $sname 2>/dev/null
if [ "$?" -eq 1 ] ; then
tmux new-session -d -s $sname
fi
tmux switch -t $sname
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment