📜  如何检查您是否在 tmux bash - 无论代码示例

📅  最后修改于: 2022-03-11 14:58:23.007000             🧑  作者: Mango

代码示例1
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