Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

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
Source by unix.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #How #check #tmux #bash
ADD COMMENT
Topic
Name
1+7 =