screen module: don't try to attach to dead screens

Removes dead screens from the list of candidate screens. Fixes issue
1253, "screen:auto-start problem with dead screens".
This commit is contained in:
Preston Hunt 2023-12-06 16:40:24 -08:00 committed by Indrajit Raychaudhuri
parent 085ab11646
commit f055c5070c

View file

@ -22,7 +22,7 @@ if [[ -z "$STY" && -z "$EMACS" && -z "$VIM" ]] && ( \
session="$(
screen -list 2> /dev/null \
| sed '1d;$d' \
| awk '{print $1}' \
| awk '!/Dead/ {print $1}' \
| head -1)"
if [[ -n "$session" ]]; then