Skip to content

Instantly share code, notes, and snippets.

@noahbliss
Last active October 26, 2020 22:44
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 noahbliss/c4631fddff2f98ac833022823784ac3e to your computer and use it in GitHub Desktop.
Save noahbliss/c4631fddff2f98ac833022823784ac3e to your computer and use it in GitHub Desktop.
tmux bashrc helpers
# Auto attach existing tmux session, if none exist, start one.
#if command -v tmux >/dev/null && ! [ $TERM == "screen" ]; then tmux a || tmux; fi
# Tell us if tmux is running or not, does _not_ auto attach.
if if command -v tmux >/dev/null && tmux ls &>/dev/null && ! [ "$TERM" == "screen" ]; then echo -e "------\n A TMUX session exists! Attach with \`tmux a\`\n------\n"; fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment