My .screenrc

June 30, 2014

Recently, Wesley David put out a call for people to share their .screenrc files, even if they aren't particularly exciting. I am a regular but not heavy user of screen and have been for years now, so I have fixed opinions (and well-worn reflexes) but not very much cleverness.

So, here are bits of my .screenrc, annotated with comments.

The most important setting for me is the simplest:

escape ^_a

This makes the screen escape character into what I consider something sane and sensible. Here 'sane and sensible' really means 'so uncommon that basically nothing else uses it'. Almost all control characters are heavily used because there's only so many of them, but ^_ is just uncommon enough that I only rarely run into collisions.

(Back in the days of real terminals there was often somewhat of an adventure in figuring out how to generate a ^_ on a new terminal.)


bell_msg "Bell is present in window % (go look at it!)"
msgwait 30

One reason I have things set this is way is xterm's ziconbeep feature. If I run screen in an xterm, any ^G in any screen will produce a message and thus trigger ziconbeep, drawing my attention to that overall screen session.

Then I have some boring settings:

defscrollback 1000
startup_message off
multiuser off
autodetach on

(The latter two settings are theoretically the default, so mentioning them explicitly is paranoia. But I'm a sysadmin. Paranoia runs deep.)

If you're running screen in an xterm, screen normally puts its 'hardstatus' line in the xterm's titlebar. Because my xterms don't have title bars, I thus need to disable this, which I do by basically turning off hardstatus in xterms:

termcapinfo xterm* LP:hs@

My taste is to not have individual screen 'windows' be present in 'who' output and so on, for reasons that are pretty much historical at this point. So I have:

deflogin off
bind U login off
bind L login on

To be honest I don't think I've used those keybindings for a very long time. I might as well leave them there; after all, someday I may them.

There is one keybinding I use all the time:

bind - prev

One reason this binding is so useful and efficient for me is that it shares a physical keyboard key with ^_, making it very quick to invoke without shifting my fingers (I just lift my left fingers off the control and shift keys). I use 'space' to cycle forwards through screen windows, which is similarly easy to hit rapidly (the spacebar is a big target).

These days I run very boring things inside screen so I basically don't auto-start anything much. Most places I start out with one shell just sitting there:

screen 0

(My .screenrc also has comments about most of this, which has been very helpful in remembering enough about why I have these mysterious settings to be able to write this entry.)

As a side note on the great screen versus tmux debate: I don't do anything sophisticated or fancy with screen and I already know how to do things with it. Thus I currently see no reason to try to switch. In general I don't dp sophisticated stuff in screen in general; that's what multiple xterm windows are for. Screen is for unusual situations when I need something to persist and one instance for monitoring stuff on my office workstation when I'm at home (and even that is increasingly historical).

Written on 30 June 2014.
« The tradeoffs for us in a SAN versus disk servers
Comparing RPM versions in the shell »

Page tools: View Source, Add Comment.
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Mon Jun 30 00:43:08 2014
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.