Copyright © 2008 Eater, All Rights Reserved.
Content is not representative of my employer.
blog.eater.org

2008-12-28

New screenrc & hardstatus string

The old one needed love.

The string escape syntax isn't obvious without spending serious quality time with the man page. (It's only slightly more intuitive than hand editing sendmal.cf.) Anyway, here it is:


# ~eater/.screenrc

shell -${SHELL} # dash (-) is for login shells
shelltitle ''
vbell on
autodetach on
startup_message off
defscrollback 8192

hardstatus alwayslastline
hardstatus string "%{= ky}%-Lw%{=r}%20>%n %t%{= ky}%+Lw %{= ky}%-=| %{= kw}%M%d %c%{-} %{=r} ${USER}@%H "

# %{= ky} set color to yellow on black.
# %{= yk} set color to black on yellow.
# %{=r} reverse the color attrs
# %-Lw all window #s, titles, and flags before the current window.
# %n %t current window number and title.
# %+Lw all windows #s, titles, and flags after the current window.
# %-= pad remaining spaces.
# %M%d month and day, like MmmDD.
# %c current time, like HH:MM.
# %H hostname

I added explicit comments for the escapes in the string. I hope that helps someone!

Remember that you can name your windows for sessions you keep around a while. Use "ctl-a A" to name them on the fly. Use "ctrl-a [num]" to jump to the window number you want.

archives