diff --git a/.bash_profile b/.bash_profile index 887a3ed..a28d956 100644 --- a/.bash_profile +++ b/.bash_profile @@ -62,8 +62,8 @@ hash screen >/dev/null 2>&1 && { SCREENS="$(screen -list | fgrep "${HOSTNAME%%.*}" | fgrep "${TTY//\//-}")" case "$(echo "${SCREENS:--n}" | wc -l)" in 0) - # No screens found - start a new instance. - screen + # No screens found - start a new instance, if on a tty. + [[ "$TTY" == *tty* ]] && screen ;; 1) # Just one screen - reconnect if it's not dead.