Skip to content

Instantly share code, notes, and snippets.

@leh
Created October 18, 2012 15:58
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save leh/3912761 to your computer and use it in GitHub Desktop.
Save leh/3912761 to your computer and use it in GitHub Desktop.
start or restore a tmux session named after your current working directory
# Switching projects like mad?
# t: start or restore a tmux session named after your current working directory
#
# e.g. calling t in /home/project/awesome_project will reattach the tmux session named
# awesome_project or create a new one
t() { tmux attach-session -t $(pwd | awk -F/ '{print $NF}') || tmux new-session -s $(pwd | awk -F/ '{print $NF}') ; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment