Skip to content

Instantly share code, notes, and snippets.

@pgib
Created August 29, 2012 05:43
Show Gist options
  • Select an option

  • Save pgib/3507218 to your computer and use it in GitHub Desktop.

Select an option

Save pgib/3507218 to your computer and use it in GitHub Desktop.
Simple .zprofile/.bash_profile entry to look for an existing screen session
if [ -z "$WINDOW" ]; then
screen -q -list
if [ $? -gt 8 ]; then
echo -n "Screen found. Re-attach? [Y/n]: "
read response
case $response in
N*|n*)
echo "Okay. Type screen -R -U -D later..."
;;
*)
screen -R -U -D
;;
esac
fi
fi
@pgib
Copy link
Author

pgib commented Aug 30, 2012

Less hacky now... /cc @vincentpants

@flyingoctopus
Copy link

i really like this. a lot.

so good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment