Home > Projects > Screen FTW

Screen FTW

If you use ssh on *nix servers, you owe it to yourself to learn and use screen. (It takes about 15 minutes to Google everything you’ll need to know to use it.)

My .screenrc file does three things for me:

  1. It automatically “detaches” when my connection drops. This lets me reconnect to whatever I had going with “screen -R” when I next log in.
  2. It processes each screen as a login shell, so that all my settings, aliases, etc. are available in each screen.
  3. It shows me a nicely formatted hardstatus line at the bottom (which I got from here).

Here’s the actual file:

autodetach on
defshell -bash

# Window list at the bottom. hostname, centered tabs and redmarked active windows:
hardstatus alwayslastline
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %d/%m %{W}%c %{g}]'

In case the formatting in that last line gets cut off in your browser, here it is:
%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %d/%m %{W}%c %{g}]

Advertisements
Categories: Projects
  1. huttarl
    February 18, 2013 at 4:27 pm

    Thanks for this … I had not heard about screen. For other clueless people like me, there’s an intro at http://www.rackaid.com/resources/linux-screen-tutorial-and-how-to/

  1. September 6, 2013 at 2:52 pm

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: