2
# tmux Start Script Need To Work!!
if which tmux >/dev/null 2>&1; then
    #if not inside a tmux session, and if no session is started, start a new session
    test -z "$TMUX" && (tmux attach || tmux new-session)
fi

fine on arch wiki site: https://wiki.archlinux.org/index.php/Tmux it differences now then what it was before

0

Screen doesn't have an environmental variable like TMUX however TERM is set to "screen", so you can check that. Screen has a way of reattaching/creating all in one flag set.

-d -R Reattach a session and if necessary detach or even create it first.

# screen Start Script Need To Work!!
if which screen >/dev/null 2>&1; then
    #if not inside a screen session, and if no session is started, start a new session
    [ "$TERM" != "screen" ] && screen -d -R
fi

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.