Created
January 12, 2025 14:22
-
-
Save huozhi/5a2f2e9e74c76f3696342e59208a414c to your computer and use it in GitHub Desktop.
Enable tmux in iterm2 only and not in other terminals
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
# Check if running in iTerm2 and `tmux` is available | |
if [[ "$TERM_PROGRAM" == "iTerm.app" ]] && command -v tmux &>/dev/null; then | |
# Start a new tmux session or attach to an existing one | |
if [[ -z "$TMUX" ]]; then | |
tmux attach || tmux new | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment