Answers for "tmux check session exists"

0

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

# Attach to created session
tmux attach-session -t $session
Posted by: Guest on October-26-2020

Code answers related to "tmux check session exists"

Browse Popular Code Answers by Language