-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.screenrc
235 lines (186 loc) · 7.68 KB
/
.screenrc
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
# Enable alternate screen support in virtual terminals, just like in xterm.
altscreen on
# don't display the copyright page
startup_message off
nethack on
deflogin on
vbell off
msgwait 2
defscrollback 3000
term screen-256color
# == Command bindings ==
# -- from RedHat --
bind = resize =
bind + resize +1
bind - resize -1
bind _ resize max
# (Note: "bind -" overrides the default binding that switches to the internal blank window)
# "bind =" overrides the default binding for 'removebuf'
# -- from Debian --
# An example of a "screen scraper" which will launch urlview on the current
# screen window
#
## bind ^B eval "hardcopy_append off" "hardcopy -h $HOME/.screen-urlview" "screen urlview $HOME/.screen-urlview"
# == Keybindings ==
# alt left-arrow key
bindkey ^[[1;3D prev
# alt right-arrow key
bindkey ^[[1;3C next
# Clear scrollback and screen of the current window. Finally, presses Ctrl-C
# for you, which abandons whatever was typed at the previous prompt and gives
# you a new one
bind ~ eval "clear" "scrollback 0" "scrollback 3000" "stuff \03"
# == backticks ==
# Generates equivalent of $STY followed by "on $HOST" if $STY is non-standard.
# (Checks only the first word of $HOST, in case it's a FQDN.)
# TO-DO: chop out the ".pts-NN"
backtick 10 60 60 sh -c 'sty=$(screen -ls | grep --color=no -o "$PPID[^[:space:]]*") ; if [ ${sty##*.} = ${HOST%%.*} ] ; then echo $sty ; else echo "$sty on ${HOST%%.*}" ; fi'
# == hardstatus ==
hardstatus on
# Derived from Red Hat's normal status line.
# includes session name thanks to backtick 10
hardstatus string "[screen %n%?: %t%? (%10`)] %h"
# %P doesn't work
## hardstatus string "[screen %n%?: %t%? (%10`)%?%P *** Hacker's treasure zoo ***%?] %h"
# %S is session name on version 4.1.0 (squeeze has v4.0.3)
## hardstatus string "[screen %n%?: %t%? (%S)] %h"
# %f is supposed to show flags of the window, but doesn't work on squeeze
## hardstatus string "[screen %n%?: %t%? (%f) on %H] %h"
# set every new window's hardstatus line to somenthing descriptive
# defhstatus "screen: ^En (^Et)"
# advertise hardstatus support to $TERMCAP
## termcapinfo * '' 'hs:ts=\E_:fs=\E\\:ds=\E_\E\\'
# combo of Debian and RedHat: don't have "screen" in dis_status_line
# (like RedHat does) but do use just the window title (not the icon).
# Set the hardstatus prop on gui terms to set the titlebar/icon title
termcapinfo xterm*|rxvt*|kterm*|Eterm* hs:ts=\E]2;:fs=\007:ds=\E]2;\007
# -- from Debian --
## # Set the hardstatus prop on gui terms to set the titlebar/icon title
## termcapinfo xterm*|rxvt*|kterm*|Eterm* hs:ts=\E]0;:fs=\007:ds=\E]0;\007
# An alternative hardstatus to display a bar at the bottom listing the
# windownames and highlighting the current windowname in blue. (This is only
# enabled if there is no hardstatus setting for your terminal)
#
## hardstatus lastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<"
# == Default windows ==
# -- from Debian --
# Example of automatically running some programs in windows on screen startup.
#
# The following will open top in the first window, an ssh session to monkey
# in the next window, and then open mutt and tail in windows 8 and 9
# respectively.
#
# screen top
# screen -t monkey ssh monkey
# screen -t mail 8 mutt
# -- from RedHat --
# screen -t local 0
# screen -t mail 1 mutt
# screen -t 40 2 rlogin server
# == Terminfo ==
# -- Change the xterm initialization string --
# The one on line 80 of Debian's /etc/screenrc is broken;
# see [default] in without section below.
# Not Debian's fault: this was taken from upstream, credited to "jw"
# (See RedHat's /etc/screenrc on line 80.)
#
# with:
# + Set Scrolling Region (DECSTBM) [jw]
# + default colours [jw] [jw]
# + DEC Private Mode Set (DECSET):
# - Wraparound Mode (DECAWM) [jw]
# + DEC Private Mode Reset (DECRST):
# - Normal Cursor Keys (DECCKM)
# - Jump (Fast) Scroll (DECSCLM) [jw, default]
# - Numeric keypad (DECNKM)
# + Reset Mode (RM):
# - Replace Mode (IRM)
# without:
# + Soft terminal reset (DECSTR) [default] -- screws up altscreen on screen v4.0.3-14
# + Erase in Display (ED): Erase All [jw]
# + Cursor Position [1,1] (CUP) [jw]
# + DEC Private Mode Reset (DECRST):
# - 80 Column Mode (DECCOLM) [default]
# - Normal Cursor Mode (DECOM) -- this causes cursor reposition to [1,1] on screen v4.1
# + Normal Keypad (DECPNM) [default]
termcapinfo xterm is=\E[r\E[m\E[?7h\E[?1;4;66l\E[4l
# terminfo default:
## termcapinfo xterm is=\E[!p\E[?3;4l\E[4l\E>
# jw, i.e. Debian:
## termcapinfo xterm is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l
# -- from RedHat --
# Make the output buffer large for (fast) xterms.
#termcapinfo xterm* OL=10000
termcapinfo xterm* OL=100
# Capabilities:
# G0 we have a SEMI-GRAPHICS-CHARACTER-MODE
# WS this sequence resizes our window.
# cs this sequence changes the scrollregion
# hs@ we have no hardware statusline. screen will only believe that
# there is a hardware status line if hs,ts,fs,ds are all set.
# ts to statusline
# fs from statusline
# ds delete statusline
# al add one line
# AL add multiple lines
# dl delete one line
# DL delete multiple lines
# ic insert one char (space)
# IC insert multiple chars
# nx terminal uses xon/xoff
# emulate part of the 'K' charset
# (this aapears to be a non-standard termcap sequence; see
# https://www.gnu.org/software/screen/manual/html_node/Termcap.html )
termcapinfo xterm* 'XC=K%,%\E(B,[\304,\\\\\326,]\334,{\344,|\366,}\374,~\337'
## # xterm-52 tweaks:
## # - uses background color for delete operations
## termcapinfo xterm* be
# terminal emulation of screen supports multiple character sets
termcapinfo facit|vt100|xterm* G0
# the vt100 description does not mention "dl". *sigh*
termcapinfo vt100 dl=5\E[M
# 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
# Terminal needs bold to display high-intensity colors
termcapinfo linux|Eterm C8
# Do not use xterms alternate window buffer.
# This one would not add lines to the scrollback buffer.
## termcapinfo xterm|xterms|xs ti=\E7\E[?47l
# -- from Debian --
# set these terminals up to be 'optimal' instead of vt100
termcapinfo xterm*|linux*|rxvt*|Eterm* OP
# == Other Stuff ==
# -- from RedHat --
# emulate .logout message
pow_detach_msg "Screen session of $LOGNAME $:cr:$:nl:ended."
# make the shell in every window a login shell
## shell -$SHELL
# This is how one can set a reattach password:
## password ODSJQf.4IJN7E # "1234"
## blankerprg rain -d 100
## idle 30 blanker
## caption always "%3n %t%? @%u%?%? [%h]%?%=%c"
# alternative caption, gives window list, LOGNAME and current date:
## caption always "%{wk}%?%-Lw%?%{bw}%n*%f %t%?(%u)%?%{wk}%?%+Lw %=%{mk}@%H %{yk}%D %{ck}%M%{wk} %{ck}%d %{gk}%c"
# == Stuff missing from RedHat's /etc/screenrc ==
# To get screen to add lines to xterm's scrollback buffer, uncomment the
# following termcapinfo line which tells xterm to use the normal screen buffer
# (which has scrollback), not the alternate screen buffer.
#
## termcapinfo xterm*|xterms|xs|rxvt ti@:te@
# Enable non-blocking mode to better cope with flaky ssh connections.
defnonblock 5
# -- from http://web.mit.edu/barnowl/etc/screenrc-4.0.3 --
# 256 COLOR SUPPORT (--asedeno)
# ... http://frexx.de/xterm-256-notes/
# use bright colors for bold text
attrcolor b ".I"
# tell screen how to set colors. AB = background, AF=foreground
# (This is unnecessary if $TERM is set properly)
# Pass codes into the window.
# (This won't work because things don't use $TERMCAP any more)
## termcapinfo xterm-256color "" 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
# erase background with current bg color
# Warning: causes TERM=screen-bce
## defbce "on"