What do you want to save?
Add Code snippet
New code examples
-
Other 2021-11-19 11:41:34
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 Add solution -
Other 2021-09-06 11:35:03
tmux check session exists
session="workspace" # Check if the session exists, discarding output # We can check $? for the exit status (zero for success, non-zero for failure) tmux has-session -t $session 2>/dev/null if [ $? != 0 ]; then # Set up your session fi # ... Add solution