-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathterminfo.src
180 lines (162 loc) · 8 KB
/
terminfo.src
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
#!/usr/bin/tic -x
xterm-12term|my terminal uwu,
## 24-bit color
setf24=\E[38\:2\:%p1%{65536}%/%d\:%p1%{256}%/%{255}%&%d\:%p1%{255}%&%dm,
setb24=\E[48\:2\:%p1%{65536}%/%d\:%p1%{256}%/%{255}%&%d\:%p1%{255}%&%dm,
# The "official" way to specify 24-bit color support is with the `RGB` capability, which signals that setaf/setab can accept 24-bit rgb values in addition to palette index numbers.
# However, this means that the indexed colors collide with the first 8 or 256 rgb colors (corresponding to dark shades of blue).
# I think this is a bad solution, so I use emacs's setf24/setb24 instead.
## another nonstandard way of announcing 24bit color support (declares support for CSI 38;2;<r>;<g>;<b>;m and 48)
Tc,
## background color erase
bce,
# This is a controversial issue... For now, my solution is:
# 1: bce is always enabled on the alternate screen
# - this is to improve compatibility and efficiency for 'graphical' programs, which run in the alternate screen
# 2: bce is enabled on the main screen, when using commands to scroll or insert/delete lines etc.
# 3: bce is DISABLED on the main screen, when printing newlines and when text wraps automatically.
# - this is so that, if a line break occurs in the middle of a highlighted region of text, it will not affect the background color of the new row.
# - I think I can get away with this, because it's rather uncommon to have large areas with custom background color on the main screen, so bce is rarely useful here.
# has automatic margins + cursor can exist in right margin column
am, xenl,
## offscreen column
# Terminals allow the cursor to be in the column just past the right edge of the screen. This, by itself, is good. BUT some terminals also have strange behaviors when in this state.
# For example, in xterm: if the cursor is in this offscreen column, `ESC [ K` (clear rest of line) will *MOVE THE CURSOR 1 space to the left*
# This causes very serious issues, because this sequence is commonly used to reset the background color as a workaround for BCE, and so in rare cases you'll lose 1 character at the edge of the screen. (I've heard this happens in both grep and gcc, for example)
# I've chosen to not implement these quirks, because as far as I know there is no advantage to doing this, and it seems like xterm is the only one that does it anyway.
# set clipboard
Ms=\E]52;%p1%s;%p2%s\007,
# set/reset cursor color/style (note the spaces before "q")
Cs=\E]12;%p1%s\007, Cr=\E]112\007,
Ss=\E[%p1%d q, Se=\E[2 q,
# allow setting window title
hs, dsl=\E]0;\007, fsl=^G, tsl=\E]0;, TS=\E]0;,
# this sets color #p1 to rgb(p2,p3,p4). the channels are specified as numbers from 0-1000.
# the code here just scales each argument to 0-4095 and formats them as "rgb:RRR/GGG/BBB" (in hex)
ccc, initc=\E]4;%p1%d;rgb\:%p2%{4095}%*%{1000}%/%3.3X/%p3%{4095}%*%{1000}%/%3.3X/%p4%{4095}%*%{1000}%/%3.3X\E\\,
oc=\E]104\007,
# set text/bg colors
# (these look complex, but all they do is output a different sequence depending on whether the argument is 0-7, 8-15, or 16-255)
setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38\:5\:%p1%d%;m,
setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48\:5\:%p1%d%;m,
colors#256, pairs#65536,
# supports SGR 39 and 49 (set text/bg color to default)
AX, op=\E[39;49m,
# no pad character
npc,
# scroll forward/backwards
indn=\E[%p1%dS, rin=\E[%p1%dT,
ind=\n, ri=\EM,
# change scroll region
csr=\E[%i%p1%d;%p2%dr,
# "special xterm sequences (OSC, mouse tracking)"
XT,
# default size
cols#80, lines#24,
# initial tab settings
it#8,
# forward/backward/set/clear tab
ht=^I, cbt=\E[Z, hts=\EH, tbc=\E[3g,
# graphics charset
smacs=\E(0, rmacs=\E(B,
acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
# styles
bold=\E[1m, dim=\E[2m, invis=\E[8m, rev=\E[7m,
smso=\E[7m, rmso=\E[27m, smul=\E[4m, rmul=\E[24m,
sgr=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p5%t;2%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m,
sgr0=\E(B\E[m,
ritm=\E[23m, sitm=\E[3m,
smxx=\E[9m, rmxx=\E[29m,
# kitty underline styling
Su,
# can move in standout mode
msgr,
# cursor visibility
cvvis=\E[?12;25h, civis=\E[?25l,
cnorm=\E[?12l\E[?25h,
# cursor movements
cuu=\E[%p1%dA, cuu1=\E[A,
cud=\E[%p1%dB, cud1=\n,
cuf=\E[%p1%dC, cuf1=\E[C,
cub=\E[%p1%dD, cub1=^H,
cup=\E[%i%p1%d;%p2%dH,
home=\E[H,
hpa=\E[%i%p1%dG,
sc=\E7, rc=\E8,
vpa=\E[%i%p1%dd,
cr=\r,
# cursor position request / response
u7=\E[6n, u6=\E[%i%d;%dR,
# enter/leave alt buffer
rmcup=\E[?1049l\E[23;0;0t, smcup=\E[?1049h\E[22;0;0t,
# delete char, line
dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M,
# erase chars
ech=\E[%p1%dX,
# clear to beginning/end of line, end of screen
el1=\E[1K, el=\E[K, ed=\E[J,
# clear scrollback
E3=\E[3J,
# clear screen and home cursor
clear=\E[H\E[2J,
# flash (todo?)
# flash=\E[?5h$<100/>\E[?5l,
bel=^G,
# insert chars/lines
ich=\E[%p1%d@, il=\E[%p1%dL, il1=\E[L,
# repeat character
rep=%p1%c\E[%p2%{1}%-%db,
# init stringps :
is2=\E[!p\E[?3;4l\E[4l\E>,
# turn auto margins on/off (TODO?)
# smam=\E[?7h, rmam=\E[?7l,
# enter/exit insert mode (TODO)
#smir=\E[4h, rmir=\E[4l, mir
# reset strings
rs1=\Ec\E]104\007, rs2=\E[!p\E[?3;4l\E[4l\E>,
# terminal enquire string, response description (todo)
u9=\E[c, u8=\E[?%[;0123456789]c,
# application/normal keypad mode
smkx=\E[?1h\E=, rmkx=\E[?1l\E>,
#
##### KEYS #####
# back tab key
kcbt=\E[Z,
# keypad (todo: actually implement numpad/keypad things)
kp5=\EOE, kpADD=\EOk, kpCMA=\EOl, kpDIV=\EOo, kpDOT=\EOn, kpMUL=\EOj, kpSUB=\EOm, kpZRO=\EOp, ka1=\EOw, ka3=\EOy, kb2=\EOu, kc1=\EOq, kc3=\EOs, kent=\EOM, kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, ka2=\EOx, kb1=\EOt, kb3=\EOv, kc2=\EOr,
# mouse things
kmous=\E[<, XM=\E[?1006;1000%?%p1%{1}%=%th%el%;, xm=\E[<%i%p3%d;%p1%d;%p2%d;%?%p4%tM%em%;,
# application mode cursor keys
kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kend=\EOF, khome=\EOH,
# function keys
kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, kf10=\E[21~, kf11=\E[23~, kf12=\E[24~,
# shift + function key
kf13=\E[1;2P, kf14=\E[1;2Q, kf15=\E[1;2R, kf16=\E[1;2S, kf17=\E[15;2~, kf18=\E[17;2~, kf19=\E[18;2~, kf20=\E[19;2~, kf21=\E[20;2~, kf22=\E[21;2~, kf23=\E[23;2~, kf24=\E[24;2~,
# ctrl + function key
kf25=\E[1;5P, kf26=\E[1;5Q, kf27=\E[1;5R, kf28=\E[1;5S, kf29=\E[15;5~, kf30=\E[17;5~, kf31=\E[18;5~, kf32=\E[19;5~, kf33=\E[20;5~, kf34=\E[21;5~, kf35=\E[23;5~, kf36=\E[24;5~,
kf37=\E[1;6P, kf38=\E[1;6Q, kf39=\E[1;6R, kf40=\E[1;6S, kf41=\E[15;6~, kf42=\E[17;6~, kf43=\E[18;6~, kf44=\E[19;6~, kf45=\E[20;6~, kf46=\E[21;6~, kf47=\E[23;6~, kf48=\E[24;6~,
# alt + function key
kf49=\E[1;3P, kf50=\E[1;3Q, kf51=\E[1;3R, kf52=\E[1;3S, kf53=\E[15;3~, kf54=\E[17;3~, kf55=\E[18;3~, kf56=\E[19;3~, kf57=\E[20;3~, kf58=\E[21;3~, kf59=\E[23;3~, kf60=\E[24;3~,
# alt + shift + function key
kf61=\E[1;4P, kf62=\E[1;4Q, kf63=\E[1;4R,
# shift,alt,shift+alt,ctrl,ctrl+shift,ctrl+alt + cursor key
kUP=\E[1;2A, kDN=\E[1;2B, kRIT=\E[1;2C, kLFT=\E[1;2D,
kUP3=\E[1;3A, kDN3=\E[1;3B, kRIT3=\E[1;3C, kLFT3=\E[1;3D,
kUP4=\E[1;4A, kDN4=\E[1;4B, kRIT4=\E[1;4C, kLFT4=\E[1;4D,
kUP5=\E[1;5A, kDN5=\E[1;5B, kRIT5=\E[1;5C, kLFT5=\E[1;5D,
kUP6=\E[1;6A, kDN6=\E[1;6B, kRIT6=\E[1;6C, kLFT6=\E[1;6D,
kUP7=\E[1;7A, kDN7=\E[1;7B, kRIT7=\E[1;7C, kLFT7=\E[1;7D,
# there is no ctrl+shift+alt?
# scorll forward/backward ? (these are same as shift + up/down)
kind=\E[1;2B, kri=\E[1;2A,
# home, end, insert, delete, pgup, pgdown
khome=\E[1~, kend=\E[4~, kich1=\E[2~, kdch1=\E[3~, kpp=\E[5~, knp=\E[6~,
# shift,alt,shift+alt,ctrl,ctrl+shift,ctrl+alt + home,end,insert,delete,pgup,pgdown
kHOM=\E[1;2H, kEND=\E[1;2F, kIC=\E[2;2~, kDC=\E[3;2~, kPRV=\E[5;2~, kNXT=\E[6;2~,
kHOM3=\E[1;3H, kEND3=\E[1;3F, kIC3=\E[2;3~, kDC3=\E[3;3~, kPRV3=\E[5;3~, kNXT3=\E[6;3~,
kHOM4=\E[1;4H, kEND4=\E[1;4F, kIC4=\E[2;4~, kDC4=\E[3;4~, kPRV4=\E[5;4~, kNXT4=\E[6;4~,
kHOM5=\E[1;5H, kEND5=\E[1;5F, kIC5=\E[2;5~, kDC5=\E[3;5~, kPRV5=\E[5;5~, kNXT5=\E[6;5~,
kHOM6=\E[1;6H, kEND6=\E[1;6F, kIC6=\E[2;6~, kDC6=\E[3;6~, kPRV6=\E[5;6~, kNXT6=\E[6;6~,
kHOM7=\E[1;7H, kEND7=\E[1;7F, kIC7=\E[2;7~, kDC7=\E[3;7~, kPRV7=\E[5;7~, kNXT7=\E[6;7~,
# backspace
kbs=^?,