GNU screen screenrc tweaks - windows and titles

Tue 22 February 2011
By mute

I decided after all these years I would rebind the CTRL+A after I ended up logging out of my shell by pressing CTRL+A CTRL+D [times 3] trying to go to the beginning of a bash prompt and delete the beginning few characters. Yes, I use CTRL+D :P

So while looking into this I found so many other useful things to do inside of .screenrc. I chose CTRL+S as my new screen command character, since nothing I do uses it, and it really shouldn't since it's the old XON/XOFF flow control.

Below is my documented .screenrc:

#we know
startup_message off

# if we accidentally hangup, don't be all attached when we come back. :P
autodetach on

# more scrollbacks!
defscrollback 10000

# disable use of the "alternate" terminal
# thus allowing scrollbars to function as normal in
# many terminal emulators! <3 it
termcapinfo xterm\* ti@:te@

# have screen update terminal emulators titlebar
termcapinfo xterm\* 'hs:ts=\\E]0;:fs=\\007:ds=\\E]0;\\007'
defhstatus "screen ^E (^Et) \| $USER@^EH"

# but dont print i.e. "bell in window 0" status craps
#hardstatus off

#default shell title. for bash, place in .bashrc to update titles to current running program:
# export PS1='\\[\\033k\\033\\\\\\]\\u@\\h:\\w\\$ '
shelltitle "$ \|bash"

#pretty window list at bottom
caption always '%{= kg}[%L=%{+u b} %=%{-u W}%?%-Lw%?%45L>%{Y}(%n\*%f%t)%?(%u)%?%{W}%+Lw%{+u b} %=%-1=%{-u g}]'

# turn off XON/XOFF, wow. seriously. whys it default, ick.
defflow off

# now we've new keys! screen command key CTRL+S
escape ^Ss

Comments