rulururu

post Automatically Start Screen

November 27th, 2006

Filed under: Linux, Operating Systems — Brenton Alker @ 22:32

I often find myself only a few minutes (or hours) into a session at the bash CLI/prompt before starting a process that takes some time to complete, such as a long SQL query, or a file download.

Being impatient as I am, I quickly reach for the trusty ‘Ctrl-A c’ key sequence to start a new Screen window, only to realise I never started screen in the first place (arg…)

To prevent such annoyance, I have added this handy snippet to my ~/.bashrc:

if [ "$STY" = "" ]; then
exec screen -RR
fi

Which automatically starts screen when you log into bash, by opening a new terminal for example. Other examples I have seen, such as on the Screen Users Mailing List use screen’s "-dR" or "-x" flags when starting screen to ensure they only have one screen open, but as I am still partial to having multiple terminals running, I currently prefer this option.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

ruldrurd
Powered by WordPress, Web Design by Laurentiu Piron Monitored by SiteUpTime
Entries (RSS) and Comments (RSS)