Created
June 28, 2009 07:12
-
-
Save VxJasonxV/137214 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
# I need to add this into my dotfiles repo. But for now, this is a cool way of getting you into your existing screen session, and get out when you detach. | |
# Put this at the bottom of your ~/.bash_profile and: | |
# 1) Upon login... it should be obvious what happens. | |
# 2) When you detach the screen session, you log out of the server. | |
# I'm a `screen` junkie when it comes to remote linux servers I rarely work outside of screen. If I need to, you can always ^C as soon as you ssh in and see "Reattaching [...]". | |
if [ -z $STY ] | |
then | |
echo "Reattaching screen in 3 seconds..." | |
sleep 3 | |
exec screen -d -RR | |
fi | |
# Thanks to sadrul on Freenode for the [ -z $STY ] tip. | |
# Thanks to JB for the idea of doing this instead of just a blind `screen -d -RR`. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment