Skip to content

Instantly share code, notes, and snippets.

@dendrochronology
Created August 20, 2018 20:02
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 dendrochronology/3b7ef2b416b59071cd1cab42e14de275 to your computer and use it in GitHub Desktop.
Save dendrochronology/3b7ef2b416b59071cd1cab42e14de275 to your computer and use it in GitHub Desktop.
VS Code shell script to launch friendly-but-uniquely named tmux sessions for each project.
#!/usr/bin/env bash
# Set terminal.integrated.shell.osx in User Settings to wherever you save this
HASH="`pwd | md5`"
SESSION="${PWD##*/} ${HASH: -6:6}"
SESSION_CLEAN="`echo $SESSION | sed 's/\.//g'`"
tmux attach-session -d -t "$SESSION_CLEAN" || tmux new-session -s "$SESSION_CLEAN"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment