.screenrc

Screen

~/.screenrc

vbell on
vbell_msg   " *X* " 

#caption always "%{= kw}%-w%{= BW}%n %t%{-}%+w %-= @%H - %LD %d %LM - %c"
#caption always "%{bk}%H%{bk}: screen%{wk} %-48=%{wk} system load: %l%{wk} | %{wk}%D %m.%d %0c"
#hardstatus alwayslastline "%?%-Lw%?%{kw}%n*%f %t%?(%u)%?%{kw}%?%+Lw%? %{wk} %-47=%{wk} system load: %l%{wk} | %{wk}%D %

hardstatus alwayslastline
hardstatus string '%{Yk}[ %{W}%H %{Y}][%= %{wk}%?%-Lw%?%{=b kR}(%{W}%n*%f %t%?(%u)%?%{=b kR})%{= kw}%?%+Lw%?%?%= %{w}][%{Y}%l%{w}]%{=w C}[ %d/%m %c ]%{W}'


screen -t xxx 0
screen -t xx
screen -t x 
screen -t top top
screen -t su su -

startup_message off

# X friendly
bindkey -k k7 detach
bindkey -k k8 kill
bindkey -k k5 screen
bindkey -k k; title
bindkey -k F3 prev
bindkey -k F4 next

xx


################
#
# bars
#
#hardstatus alwayslastline
#hardstatus string '%{= mK}%-Lw%{= KW}%50>%n%f* %t%{= mK}
#%+Lw%< %{= kG}%-=%D %d %M %Y %c:%s%{-}'

#hardstatus alwayslastline
#hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}
#(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %d/%m
#%{W}%c %{g}]'

#hardstatus alwayslastline
#hardstatus string '%{gk}[ %{G}%H %{g}][%= %{wk}%?%-Lw%?%{=b kR}
#(%{W}%n*%f %t%?(%u)%?%{=b kR})%{= kw}%?%+Lw%?%?%= %{g}][%{Y}%l%{g}]
#%{=b C}[ %m/%d %c ]%{W}'

#caption always "%{bk}%H%{gk}: screen%{gk} | %{rk}(system load: %l)%{gk} | %-21=%{gk}%D %Y.%m.%d %0c"
# hardstatus alwayslastline "%{wr}%n%f %t %{kw} | %?%-Lw%?%{wb}%n*%f %t%?(%u)%?%{kw}%?%+Lw%? %{wk}"
hardstatus alwayslastline "%?%-Lw%?%{wb}%n*%f %t%?(%u)%?%{kw}%?%+Lw%? %{wk}"

# screen -t local 0
# screen -t mail 1 elm
# screen -t 40 2 rlogin faui40

# caption always "%3n %t%? @%u%?%? [%h]%?"
# hardstatus alwaysignore
# hardstatus alwayslastline "%w"

#hardstatus alwayslastline "%{=b}%{w} Screen(s): %{b}%w %=%{kW}%C%A  %D, %M/%d/%Y "

vbell on
vbell_msg   " *X* " 

caption always "%{= kw}%-w%{= BW}%n %t%{-}%+w %-= @%H - %LD %d %LM - %c"

startup_message off

# X friendly
bindkey -k k7 detach
bindkey -k k8 kill
bindkey -k k5 screen
bindkey -k k; title
bindkey -k F3 prev
bindkey -k F4 next




ex


   1.
      bind 'R' wrap
   2.
      bind 'r' resize
   3.
      bind '+' resize +5
   4.
      bind '-' resize -5
   5.
      autodetach on # default: on
   6.
      crlf off # default: off
   7.
      deflogin off # default: on
   8.
      hardcopy_append on # default: off
   9.
      startup_message off # default: on
  10.
      vbell on # default: ???
  11.
      termcapinfo xterm ti@:te@
  12.
      termcapinfo linux "ve=E[?25hE[?17;0;64c"
  13.
      defscrollback 1000 # default: 100
  14.
      silencewait 15 # default: 30
  15.
      shell bashhardstatus alwayslastline "%{gk} ROOTLINUX %{rk}%c:%s %{y0}%d/%m/%Y %{wk}%?%-Lw%?%{wk}%n%f %{rk}[%{wk}%t%{rk}]%?(%u)%?%{wk}%?%+Lw%? %= %{ck}RENATO MICHNIK DE CARVALHO"
  16.
      sorendition kG # black  on bold green
  17.
      activity "%C -&gt; %n%f %t activity!"
  18.
      bell "------------------------------- %n%f - %t ------------------------------"
  19.
      pow_detach_msg "BYE"
  20.
      vbell_msg " *beep* "
  21.
      msgwait 1
  22.
      version
  23.
      msgwait 2
  24.
       
  25.
      # segurança: desligar algumas tecla perigosasbind k
  26.
      bind ^k
  27.
      bind '^'
  28.
      bind z
  29.
      bind ^z
  30.
      bind x
  31.
      bind s
  32.
      bind ^s
  33.
       
  34.
      # e aqui fica o kill
  35.
       
  36.
      bind 'K' kill
  37.
       
  38.
      ### do /etc/screenrctermcap  facit|vt100|xterm LP:G0
  39.
      terminfo facit|vt100|xterm LP:G0
  40.
       
  41.
      #the vt100 description does not mention "dl". *sigh*
  42.
      termcap  vt100 dl=5E[M
  43.
      terminfo vt100 dl=5E[M
  44.
       
  45.
      shelltitle '] |SHELL'#disparando uns programas automaticamente
  46.
       
  47.
      screen -t EMAIL 0 mutt
  48.
      screen -t IM 1 centericq
  49.
      screen -t MP3 2 mocp -T green_theme /media/sda5/mp3/musicas.m3u
  50.
      screen -t RL 3
  51.
      screen -t MDS 4


# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= #

### Created by Brad Sims  25/06/2004 

### I got tired of .screenrc's on the internet being so 
### poorly commented... So being a good GNUbie I took matters
### into my own hands; and wrote this dotfile.

# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= #

##    Explanation of hardstatus line    ##

# Ignore the ' marks if you use these examples for yourself

# Note that if you want to use the color brown under konsole
# You actually use bright yellow (%{Y}). 

# Note the embeded space after the colon, I feel 
#  it just looks nicer with a blank between the
#  text and console edge:
#   '%{=b}%{G} Screen(s): '

# This prints the window listing in blue:
#   '%{b}%w'

# This right-aligns what follows:
#   '%='

# This displays the time (hours and minutes) in 12hr format 
# and adds an AM/PM flag, in bold green:
#   '%{G}%C%A'

# This displays the day of the week:
#   '%D'

#This displays the date in Mon/day/year format:
# and again I embeded a space to give me one space
# between the text and console edge:
#  '%M/%d/%Y '

# The resulting command give you a status line that 
#  looks like this: 
#   | Screen(s): 0* bash           5:30PM  Fri, Jun/25/2004 |
#  (The pipes indicate the edges of the xterm/console).

# Green text, time, and date; windows in blue:
hardstatus alwayslastline "%{=b}%{G} Screen(s): %{b}%w %=%{kG}%C%A  %D, %M/%d/%Y "

# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= #

##    Some general options    ##

# Turn off start message:
startup_message off

# Set messages timeout to one second: 
msgwait 1

# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= #

##    Keybindings    ##

# bind F7  to detach screen session from this terminal
# bind F8  to kill current screen window.
# bind F9  to create a new screen
# bind F10 to rename current screen window
# bind F11 to move to previous window
# bind F12 to move to next window
bindkey -k k7 detach
bindkey -k k8 kill
bindkey -k k9 screen
bindkey -k k; title
bindkey -k F1 prev
bindkey -k F2 next

# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= #

#
# Example of a user's .screenrc file
#

# This is how one can set a reattach password:
# password ODSJQf.4IJN7E    # "1234"

# no annoying audible bell, please
vbell on

# vbell_msg:            Message shown when the
#                       "virtual bell" rings.
vbell_msg             " *beep* "

# detach on hangup
autodetach on

# don't display the copyright page
startup_message off

# 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\\'

# make the shell in every window a login shell
#shell -$SHELL

# autoaka testing
# shellaka '> |tcsh'
# shellaka '$ |sh'

# set every new windows hardstatus line to somenthing descriptive
# defhstatus "screen: ^En (^Et)"

defscrollback 1000

# don't kill window after the process died
# zombie "^["

# turn on alternate screen
altscreen on

# don't print stuff
printcmd /bin/true

################
#
# xterm tweaks
#

### #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
### 
### #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
### 
### # Make the output buffer large for (fast) xterms.
### termcapinfo xterm* OL=10000
### 
### # 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=\E[1~:kI=\E[2~:kD=\E[3~:kH=\E[4~:kP=\E[H:kN=\E[6~'
### 
### # special xterm hardstatus: use the window title.
### termcapinfo xterm 'hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007'
### 
### #terminfo xterm 'vb=\E[?5h$<200/>\E[?5l'
### termcapinfo xterm 'vi=\E[?25l:ve=\E[34h\E[?25h:vs=\E[34l'
### 
### # emulate part of the 'K' charset
### termcapinfo   xterm 'XC=K%,%\E(B,[\304,\\\\\326,]\334,{\344,|\366,}\374,~\337'
### 
### # xterm-52 tweaks:
### # - uses background color for delete operations
### termcapinfo xterm ut

# Turn off bold text and use bright colors instead
# See explanation of this stuff at
# http://aperiodic.net/screen/appearance
# http://aperiodic.net/screen/string_escapes
attrcolor b "-b .I"

################
#
# 256 color xterm tweeks
# from: http://frexx.de/xterm-256-notes/
#

# terminfo and termcap for nice 256 color terminal
# 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'
# erase background with current bg color
# defbce "on"

################
#
# wyse terminals
#

#wyse-75-42 must have flow control (xo = "terminal uses xon/xoff")
#essential to have it here, as this is a slow terminal.
# termcapinfo wy75-42 xo:hs@

# New termcap sequences for cursor application mode.
# termcapinfo wy* CS=\E[?1h:CE=\E[?1l:vi=\E[?25l:ve=\E[?25h:VR=\E[?5h:VN=\E[?5l:cb=\E[1K:CD=\E[1J

################
#
# other terminals
#

#make hp700 termcap/info better
# termcapinfo  hp700 'Z0=\E[?3h:Z1=\E[?3l:hs:ts=\E[62"p\E[0$~\E[2$~\E[1$}:fs=\E[0}\E[61"p:ds=\E[62"p\E[1$~\E[61"p:ic@'

# Extend the vt100 desciption by some sequences.
# termcap  vt100* ms:AL=\E[%dL:DL=\E[%dM:UP=\E[%dA:DO=\E[%dB:LE=\E[%dD:RI=\E[%dC
# terminfo vt100* ms:AL=\E[%p1%dL:DL=\E[%p1%dM:UP=\E[%p1%dA:DO=\E[%p1%dB:LE=\E[%p1%dD:RI=\E[%p1%dC


################
#
# keybindings
#

# 040126 To be able to select windows with n > 9 ->
# press "C-a - #" instead of just "C-a #"
  bind - command -c select_1n
  bind -c select_1n 0 select 10
  bind -c select_1n 1 select 11
  bind -c select_1n 2 select 12
  bind -c select_1n 3 select 13
  bind -c select_1n 4 select 14
  bind -c select_1n 5 select 15
  bind -c select_1n 6 select 16
  bind -c select_1n 7 select 17
  bind -c select_1n 8 select 18
  bind -c select_1n 9 select 19
  bind -c select_1n - command -c select_2n
  bind -c select_2n 0 select 20
  bind -c select_2n 1 select 21
  bind -c select_2n 2 select 22
  bind -c select_2n 3 select 23
  bind -c select_2n 4 select 24
  bind -c select_2n 5 select 25
  bind -c select_2n 6 select 26
  bind -c select_2n 7 select 27
  bind -c select_2n 8 select 28
  bind -c select_2n 9 select 29
  bind -c select_2n - select -

#remove some stupid / dangerous key bindings
bind k
bind ^k
bind .
bind ^\
bind \\
bind ^h
bind h
#make them better
bind 'K' kill
bind 'I' login on
bind 'O' login off
bind '}' history

# Yet another hack:
# Prepend/append register [/] to the paste if ^a^] is pressed.
# This lets me have autoindent mode in vi.
# register [ "\033:se noai\015a"
# register ] "\033:se ai\015a"
# bind ^] paste [.]

################
#
# default windows
#

caption always "%{bk}%H%{gk}: screen%{gk} | %{rk}(system load: %l)%{gk} | %-21=%{gk}%D %Y.%m.%d %0c"
# hardstatus alwayslastline "%{wr}%n%f %t %{kw} | %?%-Lw%?%{wb}%n*%f %t%?(%u)%?%{kw}%?%+Lw%? %{wk}"
hardstatus alwayslastline "%?%-Lw%?%{wb}%n*%f %t%?(%u)%?%{kw}%?%+Lw%? %{wk}"

# screen -t local 0
# screen -t mail 1 elm
# screen -t 40 2 rlogin faui40

# caption always "%3n %t%? @%u%?%? [%h]%?"
# hardstatus alwaysignore
# hardstatus alwayslastline "%w"

source

 
Back to top
unix/screen.txt · Last modified: 2009/07/09 20:05 (external edit)
chimeric.de = chi`s home Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0