You know, I always considered screen to be a mostly useless app. I could never get why people love it so much. Sure, it’s nice to have multiple “virtual windows” in your terminal but… I usually use KDE’s konsole which can open multiple shell tabs in a single window. You can move between tabs with shift+arrow combos. Plus you always see which tab you are in. This was alway more intuitive to me than C-a n / C-a p combos. This kinda prevented me from discovering different aspects of this program.

I finally figured out what screen is good for! I still find it useless as a shell wraparound. Tabs are way better, and the no normal scrolling issue pisses me off. But the scrolling issue goes away if you are running ncurses apps or apps that take over the terminal anyway like emacs or pine. However the true power of screen is the detach command. Picture this:

I log in to freddie from my laptop and do:

screen -S email

Inside screen I launch pine and read my emails. I start composing a mail but something comes up and I need to leave. So I do C-a d to “detach” screen session and send it to background. This session is still running even after I log out from freddie, shut down my laptop and go home.

Next I ssh into freddie from home, and attach the screen session with:

screen -x email

I can jut go back to composing my email where I left it. Pine was running all this time, it downloaded all the new emails and I did not have to re-log in. Of course the pine example is slightly trivial – but think about this:

You type make, then you log out and go on with your life. Next day you log back in, attach the session and see the results of the compilation. This is the ultimate tool for Gentoo users – just type emerge and go on vacation 🙂

So it’s official – screen is my new favorite app!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: