File tree Expand file tree Collapse file tree 3 files changed +198
-1
lines changed Expand file tree Collapse file tree 3 files changed +198
-1
lines changed Original file line number Diff line number Diff line change @@ -36,11 +36,14 @@ def generate_terminfo():
3636 os .chdir (base )
3737 sys .path .insert (0 , base )
3838
39- from kitty .terminfo import generate_terminfo
39+ from kitty .terminfo import generate_terminfo , generate_termcap
4040
4141 with open ('terminfo/kitty.terminfo' , 'w' ) as f :
4242 f .write (generate_terminfo ())
4343
44+ with open ('terminfo/kitty.termcap' , 'w' ) as f :
45+ f .write (generate_termcap ())
46+
4447 compile_terminfo (os .path .join (base , 'terminfo' ))
4548
4649
Original file line number Diff line number Diff line change @@ -428,6 +428,21 @@ def generate_terminfo():
428428 return ',\n \t ' .join (ans ) + ',\n '
429429
430430
431+ def generate_termcap ():
432+ inv_termcap_aliases = {v : k for k , v in termcap_aliases .items ()}
433+ ans = ['|' .join (names )]
434+ for cap in sorted (bool_capabilities ):
435+ if cap not in no_termcap_for :
436+ ans .append (inv_termcap_aliases [cap ])
437+ for k in sorted (numeric_capabilities ):
438+ if k not in no_termcap_for :
439+ ans .append ('{}#{}' .format (inv_termcap_aliases [k ], numeric_capabilities [k ]))
440+ for k in sorted (string_capabilities ):
441+ if k not in no_termcap_for :
442+ ans .append ('{}={}' .format (inv_termcap_aliases [k ], string_capabilities [k ]))
443+ return ':\\ \n \t :' .join (ans ) + ':\n '
444+
445+
431446octal_escape = re .compile (r'\\([0-7]{3})' )
432447escape_escape = re .compile (r'\\[eE]' )
433448
Original file line number Diff line number Diff line change 1+ xterm-kitty|KovIdTTY:\
2+ :am:\
3+ :cc:\
4+ :hs:\
5+ :km:\
6+ :5i:\
7+ :mi:\
8+ :ms:\
9+ :NP:\
10+ :xn:\
11+ :Co#256:\
12+ :co#80:\
13+ :it#8:\
14+ :li#24:\
15+ :pa#32767:\
16+ :ac=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~:\
17+ :bl=^G:\
18+ :md=\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\
78+ :k;=\E[21~:\
79+ :F1=\E[23~:\
80+ :F2=\E[24~:\
81+ :F3=\E[1;2P:\
82+ :F4=\E[1;2Q:\
83+ :F5=\E[1;2R:\
84+ :F6=\E[1;2S:\
85+ :F7=\E[15;2~:\
86+ :F8=\E[17;2~:\
87+ :F9=\E[18;2~:\
88+ :k2=\EOQ:\
89+ :FA=\E[19;2~:\
90+ :FB=\E[20;2~:\
91+ :FC=\E[21;2~:\
92+ :FD=\E[23;2~:\
93+ :FE=\E[24;2~:\
94+ :FF=\E[1;5P:\
95+ :FG=\E[1;5Q:\
96+ :FH=\E[1;5R:\
97+ :FI=\E[1;5S:\
98+ :FJ=\E[15;5~:\
99+ :k3=\EOR:\
100+ :FK=\E[17;5~:\
101+ :FL=\E[18;5~:\
102+ :FM=\E[19;5~:\
103+ :FN=\E[20;5~:\
104+ :FO=\E[21;5~:\
105+ :FP=\E[23;5~:\
106+ :FQ=\E[24;5~:\
107+ :FR=\E[1;6P:\
108+ :FS=\E[1;6Q:\
109+ :FT=\E[1;6R:\
110+ :k4=\EOS:\
111+ :FU=\E[1;6S:\
112+ :FV=\E[15;6~:\
113+ :FW=\E[17;6~:\
114+ :FX=\E[18;6~:\
115+ :FY=\E[19;6~:\
116+ :FZ=\E[20;6~:\
117+ :Fa=\E[21;6~:\
118+ :Fb=\E[23;6~:\
119+ :Fc=\E[24;6~:\
120+ :Fd=\E[1;3P:\
121+ :k5=\E[15~:\
122+ :Fe=\E[1;3Q:\
123+ :Ff=\E[1;3R:\
124+ :Fg=\E[1;3S:\
125+ :Fh=\E[15;3~:\
126+ :Fi=\E[17;3~:\
127+ :Fj=\E[18;3~:\
128+ :Fk=\E[19;3~:\
129+ :Fl=\E[20;3~:\
130+ :Fm=\E[21;3~:\
131+ :Fn=\E[23;3~:\
132+ :k6=\E[17~:\
133+ :Fo=\E[24;3~:\
134+ :Fp=\E[1;4P:\
135+ :Fq=\E[1;4Q:\
136+ :Fr=\E[1;4R:\
137+ :k7=\E[18~:\
138+ :k8=\E[19~:\
139+ :k9=\E[20~:\
140+ :%1=:\
141+ :kh=\EOH:\
142+ :kI=\E[2~:\
143+ :kF=\E[1;2B:\
144+ :Km=\E[M:\
145+ :kN=\E[6~:\
146+ :kP=\E[5~:\
147+ :kR=\E[1;2A:\
148+ :&8=:\
149+ :oc=\E]104\007:\
150+ :op=\E[39;49m:\
151+ :rc=\E8:\
152+ :mr=\E[7m:\
153+ :sr=\EM:\
154+ :SR=\E[%p1%dT:\
155+ :ZR=\E[23m:\
156+ :ae=\E(B:\
157+ :RA=\E[?7l:\
158+ :te=\E[?1049l:\
159+ :ei=\E[4l:\
160+ :ke=\E[?1l:\
161+ :se=\E[27m:\
162+ :ue=\E[24m:\
163+ :r1=\E]\E\\\Ec:\
164+ :sc=\E7:\
165+ :AB=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m:\
166+ :AF=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m:\
167+ :sa=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m:\
168+ :me=\E(B\E[m:\
169+ :ZH=\E[3m:\
170+ :as=\E(0:\
171+ :SA=\E[?7h:\
172+ :ti=\E[?1049h:\
173+ :im=\E[4h:\
174+ :ks=\E[?1h:\
175+ :so=\E[7m:\
176+ :us=\E[4m:\
177+ :ct=\E[3g:\
178+ :ts=\E]2;:\
179+ :cv=\E[%i%p1%dd:
You can’t perform that action at this time.
0 commit comments