On Fri, Jan 2, 2009 at 6:08 AM, Michael Grant <mgr...@grant.org> wrote:

> Here is what I use in my .bash_login:
>
> if screen -wipe 2>&1 | egrep -v "No Sockets found" >/dev/null; then
>  echo -n "Reattach to detached tree? (y/n) [space=y] "
>  read -n1 a;
>  if [[ ("$a" = "y") || ("$a" = "") ]]; then
>    exec screen -xRR
>  fi
>  echo ""
> else
>  echo "type 'screen' to start screen"
> fi

due to additional requirements, i have this:

if [[ "$TERM" != vt320 ]]; then
  if ! which screen|grep "no screen"; then
    if screen -ls|head -n3|tail -n2|cut -f2|cut -d. -f2-|grep -q
'^'main'$'; then
      exec screen -r main
    else
      exec screen -S main
    fi
  fi
fi

the extra "if" is due to my generally having at least one detached
"daemon" screen hanging around. (the TERM test filters out my
blackberry's ssh app. i have enough trouble using it without dealing
with ^A :)

a named version of -D -RR (attach to named screen (power-detaching
others if necessary) if exists, create if not) would be a welcome
alternative: "screen -D -RR main"
-- 
Aaron Davies
aaron.dav...@gmail.com


_______________________________________________
screen-users mailing list
screen-users@gnu.org
http://lists.gnu.org/mailman/listinfo/screen-users

Reply via email to