Skip to content

Instantly share code, notes, and snippets.

@YuanLiou
Created February 17, 2024 08:51
Show Gist options
  • Save YuanLiou/b91fa876825e947bc40ee84ab6984e44 to your computer and use it in GitHub Desktop.
Save YuanLiou/b91fa876825e947bc40ee84ab6984e44 to your computer and use it in GitHub Desktop.
use Tmux only if current term program is Apple Terminal
# use Tmux only if current term program is Apple Terminal
if [ "$TERM_PROGRAM" = 'Apple_Terminal' ]; then
tmux has -t hack &> /dev/null
if [ $? != 0 ]; then
tmux new -s hack
elif [ -z $TMUX ]; then
tmux attach -t hack
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment