How to check if you are in tmux bash code example
Example: How to check if you are in tmux bash
if [[ "$TERM" =~ "screen".* ]]; then
echo "We are in TMUX!"
else
echo "We are not in TMUX :/ Let's get in!"
# Launches tmux in a session called 'base'.
tmux attach -t base || tmux new -s base
fi