Created
January 10, 2025 16:10
-
-
Save x-zvf/c15172d7fde43e16b39163d4150971f4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# place this at the end of your .(bash|zsh)rc | |
if command -v tmux &> /dev/null && [ -n "$PS1" ] && [[ ! "$TERM" =~ screen ]] && [[ ! "$TERM" =~ tmux ]] && [ -z "$TMUX" ]; then | |
if tmux list-sessions > /dev/null; then | |
exec tmux attach | |
else | |
exec tmux | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment