shell-command-to-string 実行時の $TERM
dumb の場合と ""(空文字列) の場合がある?
起動直後は空文字列みたい。
なので tmux は↓みたいな感じに。
if which tmux 2>&1 >/dev/null; then #if not inside a tmux session, and if no session is started, start a new session test -z "$TMUX" && test "$TERM" != "dumb" && test "$TERM" != "" && (tmux attach || tmux new-session) fi