Skip to content

Instantly share code, notes, and snippets.

@alchen99
Created July 28, 2020 00:17
Show Gist options
  • Save alchen99/4a386a801bdfe13007ba489383c4acb6 to your computer and use it in GitHub Desktop.
Save alchen99/4a386a801bdfe13007ba489383c4acb6 to your computer and use it in GitHub Desktop.
Screen rc file
shell -${SHELL}
# kill startup message
startup_message off
# define bigger scrollback, default is 100 lines
defscrollback 10000
# Prefer an audible bell to the visual one
vbell off
# use Ctrl-` as the command character
#escape
# This is how one can set a reattach password :
# password LUFUw1ppDOBhg # same as unix password
# if terminal hangs up abruptly detach and keep screen running in the background
autodetach on
# Emulate .logout message
pow_detach_msg "Screen session of \$LOGNAME \$:cr:\$:nl:ended."
# advertise hardstatus support to $TERMCAP
# termcapinfo * '' 'hs:ts=\E_:fs=\E\\:ds=\E_\E\\'
# an alternative hardstatus to display a bar at the bottom listing the
# window names and highlighting the current windowname in blue. (This is
# only enabled if there is no hardstatus setting for your terminal)
hardstatus on
hardstatus alwayslastline
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{=kw}%?%-Lw%?%{r}(%{W}%n*%f %t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B}%Y-%m-%d %{W}%c %{g}].'
#hardstatus string '%{= kG}%{C}Screen: %{c}%{= kG}[%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{C} %d-%m %{W}%c %{g}]'
#hardstatus string '%{= kG}%-Lw%{= kW}%50> %n*%f %t%{= kG}%+Lw%< %{= kG}%-=%D %m/%d/%y | %C:%s %A | %1`%{-}'
#hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m-%d %{W}%c %{g}]'
#hardstatus string '%{= M} %H%{= G} %l %= %{= w}%-w%{+b r}%n*%t%{-b r}%{w}%+w %= %{c}%d %D %{B}%c '
#hardstatus string '%{= kG}%-Lw%{= kW}%50> %n%f* %t%{= kG}%+Lw%< %{= kG}%-=%c:%s%{-}'
#hardstatus string "%w"
#hardstatus string "%{.kW}%-w%{.W}%n %t%{-}%{=b kw}%?%+w%?" #B&W
#hardstatus string "%{.kW}%-w%{.W}%n %t%{-}%{=b kw}%?%+w%? %=%c %d/%m/%Y" #B&W & date&time
#hardstatus string "%{.kW}%-w%{.W}%n %t%{-}%{=b kw}%?%+w%? %=%c %d/%m/%Y" #B&W & date&time
#hardstatus string '%{= R}[%{w}%H%{R}][%{w}%=%?%-Lw%?%{R}%n*%f%t%?(%u)%? %{w}%?%+Lw%?%?%=%{R}][%{w}%m/%d %{W}%C%A%{R}]'
#hardstatus string "%{.kW}%-w%{.W}%n %t%{-}%+w %=%C %a "
#hardstatus string "%{=b kw} %?%-Lw%?%{=br kw}[%n %t]%{=b kw}%?%+Lw%? %="
#hardstatus alwayslastline '%{bk}[ %{W}%H %{b}][ %{w}%l%{b} ] %{b}[%{w} %D %d.%m %c:%s%{b} ]'
#hardstatus alwayslastline '%{bk}[%{W}%H%{b}] %{w} %l %= %n*%t%{-b r}%{w}%+w %= %{w}%d %D %{w}%c'
#hardstatus alwayslastline '%{wk}[ %{g}][%= %{wk}%?%-Lw%?%{=b kR}(%{W}%n*%f %t%?(%u)%?%{=b kR})%{= kw}%?%+Lw%?%?%= %{g}][%{Y}%l%{g}]%{=b C}[ %m/%d %c ]%{W}'
# Display $USER and screen titles in a neat way :P
#caption always "%{=b dy}{ %{= dm}${USER} %{=b dy}}%={ %?%{= dc}%-Lw%?%{+b dy}(%{-b r}%n:%t%{+b dy})%?(%u)%?%{-dc}%?%{= dc}%+Lw%? %{=b dy}}"
# Do not change the width back to 80 characters on startup
termcap xterm* 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l'
terminfo xterm* 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l'
#------------------------------------
# Bind keys
#_-----------------------------------
# bind the following to allow direct selection of screen numbers 11-20
bind ! select 11
bind @ select 12
bind \# select 13
bind $ select 14
bind % select 15
bind \^ select 16
bind & select 17
bind * select 18
bind ( select 19
bind ) select 10
#------------------------------------
# STARTUP SCREENS
#------------------------------------
chdir $HOME
screen -t 'HOME1' 0
screen -t 'HOME2' 1
screen -t 'HOME3' 2
select 0 # this selects screen 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment