# -------------------------------------------------------------------
# Settings
# -------------------------------------------------------------------
-crlf off # No Microsoft linebreaks
+crlf off # no DOS-style linebreaks
startup_message off # bypass GPL notice (we're aware)
-vbell off # Use audio bell
+vbell off # use audio bell
defscrollback 15000 # big scrollback
shell bash # don't start login shells
shelltitle "sh" # no title by default - set in PS1
-#defmonitor on # turn on monitoring
-#activity "%c activity <%n>" # let you know when stuff happens!
nethack off # makes error messages cryptic
pow_detach_msg "Screen session of \$LOGNAME \$:cr:\$:nl:ended."
autodetach on
-term xterm
+term screen # $TERM="screen"
-# Use UTF-8
+# use UTF-8
defutf8 on
defencoding UTF-8
setenv LANG 'en_US.UTF-8'
# status line to display a bar at the bottom listing the window
-# names and highlighting the current windowname in blue.
+# names and highlighting the current windowname.
# (http://www.ibm.com/developerworks/aix/library/au-gnu_screen/index.html)
-hardstatus alwayslastline "%{.bw}%-w%{+b .rW}%n %t%{-}%+w %=%{..G} %H %{..Y} "
+# (http://superuser.com/questions/212392/how-to-include-screens-session-name-in-hardstatus)
+hardstatus alwayslastline '%{= K}%-w%{+b .KW}%n %t%{-}%+w %=%{..b} %H (%`) '
+backtick 0 30 30 sh -c 'screen -ls | grep --color=no -o "$PPID[^[:space:]]*"'
-# enable bold
-attrcolor b ".I"
+# -------------------------------------------------------------------
+# Terminal Emulation Settings
+# -------------------------------------------------------------------
# allow 256 colors
-termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
+attrcolor b ".I" # use bright colors for bold text
+termcapinfo xterm* 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' # tell screen how to set colors. AB = background, AF=foreground
+defbce on # erase background with current bg color
-# disable altscreen, so PuTTy + screen play nicely together
+# enable altscreen, and disable ti/te initializations to allow PuTTy scrollback.
+# (http://www4.cs.fau.de/~jnweiger/screen-faq.html)
+altscreen on
termcapinfo xterm* 'ti@:te@'
-altscreen off
# xterm understands both im/ic and doesn't have a status line.
# Note: Do not specify im and ic in the real termcap/info file as
# some programs (e.g. vi) will not work anymore.
-termcap xterm 'hs@:cs=\E[%i%d;%dr:im=\E[4h:ei=\E[4l'
-terminfo xterm 'hs@:cs=\E[%i%p1%d;%p2%dr:im=\E[4h:ei=\E[4l'
-termcap xterm-color 'hs@:cs=\E[%i%d;%dr:im=\E[4h:ei=\E[4l'
-terminfo xterm-color 'hs@:cs=\E[%i%p1%d;%p2%dr:im=\E[4h:ei=\E[4l'
+termcap xterm* 'hs@:cs=\E[%i%d;%dr:im=\E[4h:ei=\E[4l'
+terminfo xterm* 'hs@:cs=\E[%i%p1%d;%p2%dr:im=\E[4h:ei=\E[4l'
# our xterm has colors! (rxvt, too)
termcap xterm* 'AF=\E[3%dm:AB=\E[4%dm'
terminfo xterm* 'AF=\E[3%p1%dm:AB=\E[4%p1%dm'
# this makes backspace sane on debian systems
-termcapinfo xterm 'bc@:bs@'
-termcapinfo xterm-color 'bc@:bs@'
+termcapinfo xterm* 'bc@:bs@'
# 80/132 column switching must be enabled for ^AW to work
# change init sequence to not switch width
-termcapinfo xterm 'Z0=\E[?3h:Z1=\E[?3l:is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l'
-termcapinfo xterm-color 'Z0=\E[?3h:Z1=\E[?3l:is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l'
+termcapinfo xterm* 'Z0=\E[?3h:Z1=\E[?3l:is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l'
# tell screen that xterm can switch to dark background and has function
# keys.
-termcapinfo xterm 'VR=\E[?5h:VN=\E[?5l'
-termcapinfo xterm 'k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~'
-termcapinfo xterm 'kh=\EOH:kI=\E[2~:kD=\E[3~:kH=\EOF:kP=\E[5~:kN=\E[6~'
-termcapinfo xterm-color 'VR=\E[?5h:VN=\E[?5l'
-termcapinfo xterm-color 'k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~'
-termcapinfo xterm-color 'kh=\EOH:kI=\E[2~:kD=\E[3~:kH=\EOF:kP=\E[5~:kN=\E[6~'
+termcapinfo xterm* 'VR=\E[?5h:VN=\E[?5l'
+termcapinfo xterm* 'k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~'
+termcapinfo xterm* 'kh=\EOH:kI=\E[2~:kD=\E[3~:kH=\EOF:kP=\E[5~:kN=\E[6~'
# make the output buffer large for (fast) xterms.
termcapinfo xterm* 'OL=10000'
# emulate part of the 'K' charset
termcapinfo xterm* 'XC=K%,%\E(B,[\304,\\\\\326,]\334,{\344,|\366,}\374,~\337'
+# -------------------------------------------------------------------
+# Key Bindings
+# -------------------------------------------------------------------
+
# remove some stupid / dangerous key bindings
bind k
bind ^K
bind \\
bind ^\
-# add some useful key bindings
+# easier windowlist
bind ' ' windowlist -b
+# shift+0-9 to select screens 10-19
bind ')' select 10
bind '!' select 11
bind '@' select 12