Skip to content

Instantly share code, notes, and snippets.

@ChrisWills
Created November 3, 2011 17:50
Show Gist options
  • Select an option

  • Save ChrisWills/1337178 to your computer and use it in GitHub Desktop.

Select an option

Save ChrisWills/1337178 to your computer and use it in GitHub Desktop.
A nice default screenrc
# GNU Screen - main configuration file
# All other .screenrc files will source this file to inherit settings.
# Author: Christian Wills - cwills.sys@gmail.com
# Allow bold colors - necessary for some reason
attrcolor b ".I"
# Tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
# Enables use of shift-PgUp and shift-PgDn
termcapinfo xterm|xterms|xs|rxvt ti@:te@
# Erase background with current bg color
defbce "on"
# Enable 256 color term
term xterm-256color
# Cache 30000 lines for scroll back
defscrollback 30000
# New mail notification
backtick 101 30 15 $HOME/bin/mailstatus.sh
hardstatus alwayslastline
# Very nice tabbed colored hardstatus line
hardstatus string '%{= Kd} %{= Kd}%-w%{= Kr}[%{= KW}%n %t%{= Kr}]%{= Kd}%+w %-= %{KG} %H%{KW}|%{KY}%101`%{KW}|%D %M %d %Y%{= Kc} %C%A%{-}'
# change command character from ctrl-a to ctrl-b (emacs users may want this)
#escape ^Bb
# Hide hardstatus: ctrl-a f
bind f eval "hardstatus ignore"
# Show hardstatus: ctrl-a F
bind F eval "hardstatus alwayslastline"
@jenia
Copy link
Copy Markdown

jenia commented Jan 31, 2015

Thanks very much for the config file.
I have a small problem with it though. I often get this error message on the bottom line: Message 12549 of 12588 bytes to small.

Actually, its the
hardstatus string '%{= Kd} %{= Kd}%-w%{= Kr}[%{= KW}%n %t%{= Kr}]%{= Kd}%+w %-= %{KG} %H%{KW}|%{KY}%101`%{KW}|%D %M %d %Y%{= Kc} %C%A%{-}'

line that causes it. What is that? How can I remove it?

@rdpanek
Copy link
Copy Markdown

rdpanek commented Aug 10, 2015

Thanks

@qayshp
Copy link
Copy Markdown

qayshp commented Oct 15, 2015

What does your mailstatus.sh script print? Just an unread message count?

@HengyuSama
Copy link
Copy Markdown

Amazing config file. I had fixed the annoying screen 8 colors using your config file.Thanks

@ngovanmao
Copy link
Copy Markdown

Thanks a lot!

@micwin
Copy link
Copy Markdown

micwin commented Jul 19, 2016

wow, thanks a lot!

@mastropinguino
Copy link
Copy Markdown

Good work,.. thanks a lot !!

@rrbarreto
Copy link
Copy Markdown

Great screen configuration, thank you for sharing

@cws-khuntly
Copy link
Copy Markdown

@markcurtis1970
Copy link
Copy Markdown

Excellent example, thank you!

@nitintt1991
Copy link
Copy Markdown

How do implement these changes into screen

@arainho
Copy link
Copy Markdown

arainho commented Jun 20, 2018

great 👍

@fake-name
Copy link
Copy Markdown

Really needs

startup_message off

To kill the startup splash.

@Bikette
Copy link
Copy Markdown

Bikette commented Jul 26, 2019

How do implement these changes into screen

in your home dir, create .screenrc file and paste in, run screen with your user with the command "screen -D -RR" to reattach all previous.

@RenatoSalles007
Copy link
Copy Markdown

Thanks, very usefull

@lanthean
Copy link
Copy Markdown

lanthean commented Sep 13, 2022

How do implement these changes into screen

After You've updated your ~/.screenrc file, just press (within screen) "ctrl" with "a", then type source ~/.screenrc after a colon, like this - ":source ~/.screenrc" and press "enter"
ctrl-a :source ~/.screenrc <enter>

@camilocarrillo
Copy link
Copy Markdown

Indeed, thanks for sharing! Nice layout and colors choice.

@RenatoSalles007
Copy link
Copy Markdown

Another option for status line, with date and clock:
hardstatus string '%{= Kd} %{= Kd}%-w%{= Kr}[%{= KW}%n %t%{= Kr}]%{= Kd}%+w %-= %{KG} %H%{KW}|%{KY}%101`%{KW}|%D %M %d %Y%{= Kc} %C%A%{-}'

@mikegilchrist
Copy link
Copy Markdown

I'm confused. I thought the below code would allow me to scrollback using Shift-PgUp/Down, but instead it cycles me through the windows. Is this cycling the expected behavior?

# Enables use of shift-PgUp and shift-PgDn
termcapinfo xterm|xterms|xs|rxvt ti@:te@

@la11111
Copy link
Copy Markdown

la11111 commented Feb 17, 2026

thanks
the default colors are unreadable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment