Created
August 29, 2012 05:43
-
-
Save pgib/3507218 to your computer and use it in GitHub Desktop.
Simple .zprofile/.bash_profile entry to look for an existing screen session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Less hacky now... /cc @vincentpants