Linux Screen Config

Screen is a very useful utility for managing multiple terminal windows, especially over a remote server. This is the .screenrc config that I use.

Example of screen.

Example of screen.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#status line
hardstatus alwayslastline
hardstatus string '%{= kG}[%{W}%H %{M}%S%{G}] %{= kw}%-w%{+b wW} %n %t%?(%u)%? %{-}%+w %= %{G}[%{W}%D %d %M %Y %c%{G}]'

# caption under windows
caption splitonly "%{= wk}%?%F%{=b wW}%?%3n %t"

# scrollback buffer
defscrollback 8192

# no welcome message
startup_message off

# disable tab-completion flash
vbell off

# 256 colors
attrcolor b ".I"
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
defbce on

# mouse tracking allows to switch region focus by clicking
#mousetrack on

# grey border/highlight
sorendition =s kw

# navigating regions with Ctrl-arrows
bindkey "^[[1;5D" focus left
bindkey "^[[1;5C" focus right
bindkey "^[[1;5A" focus up
bindkey "^[[1;5B" focus down

# F2 for resize mode
bindkey "^[OQ" eval "command -c rsz" # enter resize mode
# use hjkl keys to resize regions in resize mode
bind -c rsz h eval "resize -h -5" "command -c rsz"
bind -c rsz j eval "resize -v -5" "command -c rsz"
bind -c rsz k eval "resize -v +5" "command -c rsz"
bind -c rsz l eval "resize -h +5" "command -c rsz"

#clear the buffer
bind '/' eval "clear" "scrollback 0" "scrollback 8192"

#stops from accidentally softlocking in ssh
bind x