Skip to content

Instantly share code, notes, and snippets.

@Glutnix
Last active December 18, 2015 17:28
Show Gist options
  • Save Glutnix/5818428 to your computer and use it in GitHub Desktop.
Save Glutnix/5818428 to your computer and use it in GitHub Desktop.
Notification of existing tmux sessions. Add this to your .bashrc or .zshrc to be told when you login.
if [ -z "$TMUX" ]; then # not currently in a tmux session
tmux has-session >/dev/null 2>/dev/null
if [ $? = 0 ]; then # previous command exited with status 0
echo " "
echo "tmux: There are tmux session(s) running."
tmux ls
echo "run 'tmux attach' to re-attach."
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment