From ade45289efdb7b5385193485968adc19c88d40b4 Mon Sep 17 00:00:00 2001 From: Darren 'Tadgy' Austin Date: Sat, 27 Mar 2021 14:45:58 +0000 Subject: [PATCH] Only automatically start a screen session on console. --- .bash_profile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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.