Created
October 26, 2008 22:25
-
-
Save nex3/19960 to your computer and use it in GitHub Desktop.
This file contains 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
# Thanks to Bill Clementson for parts of this snippet | |
# http://bc.tech.coop/ | |
function start_or_join_screen { | |
if [ "$TERM" != dumb -a "$PS1" != "" -a "${STARTED_SCREEN:-x}" = x -a "${SSH_TTY:-x}" ] | |
then | |
STARTED_SCREEN=1 ; export STARTED_SCREEN | |
sleep 1 | |
if screen -RR | |
then | |
test -e /tmp/$USER_screen_abnormal_exit || exit 0 | |
rm /tmp/$USER_screen_abnormal_exit | |
else | |
echo "Screen failed! continuing with normal bash startup" | |
fi | |
fi | |
} | |
function descreen { | |
touch /tmp/$USER_screen_abnormal_exit | |
screen -X quit | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment