terminfo revision 4419d26b
1# $XTermId: terminfo,v 1.203 2022/02/01 00:35:15 tom Exp $
2#
3# Updates/notes/new entries (e.g., xterm-8bit, xterm-16color, xterm-256color)
4# - Thomas E. Dickey
5#
6#------------------------------------------------------------------------------
7# Copyright 1996-2021,2022 by Thomas E. Dickey
8#
9#                         All Rights Reserved
10#
11# Permission is hereby granted, free of charge, to any person obtaining a
12# copy of this software and associated documentation files (the
13# "Software"), to deal in the Software without restriction, including
14# without limitation the rights to use, copy, modify, merge, publish,
15# distribute, sublicense, and/or sell copies of the Software, and to
16# permit persons to whom the Software is furnished to do so, subject to
17# the following conditions:
18#
19# The above copyright notice and this permission notice shall be included
20# in all copies or substantial portions of the Software.
21#
22# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
25# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
26# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
27# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
28# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29#
30# Except as contained in this notice, the name(s) of the above copyright
31# holders shall not be used in advertising or otherwise to promote the
32# sale, use or other dealings in this Software without prior written
33# authorization.
34#------------------------------------------------------------------------------
35# format (ncurses 6.1): tic -I -W -1 -f -x terminfo
36#------------------------------------------------------------------------------
37#
38# Special Capabilities:
39# --------------------
40# ich has a corresponding capability that inserts a single blank.  We could
41#	have used ich1=\E[@, which works with ncurses, but that is not standard
42#	behavior.  If it is set, then SVr4 vi (e.g., Solaris 2.6) emits both
43#	smir/rmir and ich1.
44# meml locks memory above the cursor; memu unlocks (ala HP terminals).  This
45#	is not recognized by some older (e.g., SVr3) tic programs, but none
46#	do more than warn about it.  Ignore the warning.
47# smcup clears memory before switching to the alternate screen.  The older
48#	(deprecated) \E[?47h did not do this, requiring applications to
49#	embed a \E[2J in the rmcup string.  However, that behavior cannot
50#	be disabled via titeInhibit, making that resource not function as
51#	intended on systems with terminfo.
52# rs2/is2 are shorter with XFree86 xterm because it supports DECSTR.  We
53#	use the shorter sequence for compatibility with the termcap, which
54#	is trimmed to keep it shorter than 1023 characters.  It (escape \E[!p)
55#	replaces these in the conventional vt100 reset-string:
56#		\E7	- save cursor (fixes origin-mode side-effect)
57#		\E[r	- reset scrolling margins
58#		\E[m	- reset SGR (including color)
59#		\E[?7h	- reset wraparound mode (DECAWM)
60#		\E[?1l	- reset application cursor keys (DECCKM)
61#		\E[?6l	- reset origin mode (DECOM)
62#		\E8	- restore cursor
63#	DECSTR is recognized by XFree86 xterm even in vt52 mode.
64#
65# Editing Keypad:
66# --------------
67# XFree86 xterm emulates vt220 if the decTerminalID resource is set to 200 or
68# higher.  Otherwise it emulates a vt100 or vt52 depending on the value of the
69# resource.  When emulating a vt220, we support the editing keypad.  Sun and PC
70# keyboards have an editing keypad which is similar to the vt220:
71#
72#	VT220 editing keypad
73#	----------------------------
74#	Find      Insert      Remove
75#	Select    Prev        Next
76#	----------------------------
77#
78#	Sun/PC editing keypad
79#	----------------------------
80#	Insert    Home        PageUp
81#	Delete    End         PageDn
82#	----------------------------
83#
84# If the sunKeyboard resource is true, we map it this way (adjusting the values
85# of Home, End and Delete):
86#	VT220		      Sun/PC
87#	----------------------------
88#	Find		      Home
89#	Select		      End
90#	Insert		      Insert
91#	Remove		      Delete
92#	Prev		      PageUp
93#	Next		      PageDn
94#	----------------------------
95#
96# Note that all of the keys on the editing keypad transmit escape sequences.  A
97# vt220 does this only when in vt220 mode; when emulating a vt100 the editing
98# keypad is inactive.
99#
100# Alternative keycodes:
101# --------------------
102# Several of the function keys have alternative names, depending on the type of
103# host which your xterm is connected to.  DEC (i.e., the VMS system) uses F15
104# as the HELP key, F16 as the DO key.  Unix applications generally do not do
105# this.  Curses applications in particular, assign a unique keycode to each
106# capability string.  These terminal descriptions do not have conflicting
107# definitions, to ensure that Unix curses applications use a consistent set of
108# keycodes.  To get a VMS-bias, make these substitutions:
109#	1. change khome to kfnd
110#	2. change kend to kslt
111# The original xterm-r6 entry does in fact have a VMS bias.
112#
113# Some legacy applications using the termcap emulation may expect kll where
114# we have specified kend.
115#
116# Function keys with modifiers (Sun/PC):
117# -------------------------------------
118#	Shift-Fx          - kf{12+x}
119#	Control-Fx        - kf{24+x}
120#	Shift-Control-Fx  - kf{36+x}
121#
122# The terminfo defines some special keys which are documented as "shifted",
123# e.g., kDC is shifted-delete-character.
124#
125# Note however, that even though the terminfo says a key might be sent, there
126# may be conflicts which prevent this.  For example, it is common to use
127# shifted pageup and pagedown for window manager functions.  The default
128# translation for xterm since X11R4 has overridden shifted Insert, Select,
129# PageUp and PageDown, which correspond to terminfo kIC, kEND, kPRV and kNXT
130# respectively.
131#
132xterm-new|modern xterm terminal emulator,
133	npc,
134	indn=\E[%p1%dS,
135	kcbt=\E[Z,
136	kent=\EOM,
137	nel=\EE,
138	use=dec+sl,
139	use=ecma+index,
140	use=xterm+keypad,
141	use=vt420+lrmm,
142	use=xterm+sm+1006,
143	use=ansi+rep,
144	use=ecma+strikeout,
145	use=xterm+pcfkeys,
146	use=xterm+tmux,
147	use=xterm+nofkeys,
148
149# Left/right margins are supported in xterm since patch #279 (2012/05/10)
150vt420+lrmm|VT420 left/right margins,
151	mgc=\E[?69l,
152	smglp=\E[?69h\E[%i%p1%ds,
153	smglr=\E[?69h\E[%i%p1%d;%p2%ds,
154	smgrp=\E[?69h\E[%i;%p1%ds,
155
156# These "ansi+XXX" blocks were added in ncurses 5.0:
157ansi+rep,
158	rep=%p1%c\E[%p2%{1}%-%db,
159
160ansi+enq|ncurses extension for ANSI ENQ,
161	u6=\E[%i%d;%dR,
162	u7=\E[6n,
163	u8=\E[?%[;0123456789]c,
164	u9=\E[c,
165
166# Encode modifiers using parameters (see "Xterm Control Sequences" ctlseqs.ms).
167# Note that this is unrelated to PCTERM.
168#
169# Some names are extensions allowed by ncurses, e.g.,
170#	kDN, kDN5, kDN6, kLFT5, kLFT6, kRIT5, kRIT6, kUP, kUP5, kUP6
171#
172# The uppercase names are made up, since there are no standards that apply.
173# If they were limited to two characters, they could in principle be translated
174# to termcap.  However, termcap sizes are limited to 1023 bytes, so there is
175# little point in ensuring that extended key names can be translated to
176# termcap.  A terminfo file can be up to 4096 bytes; using all extended keys
177# that xterm can generate would in fact exceed that limit.
178#
179# The numbers correspond to the modifier parameters documented in Xterm
180# Control Sequences:
181#
182#	2	Shift
183#	3	Alt
184#	4	Shift + Alt
185#	5	Control
186#	6	Shift + Control
187#	7	Alt + Control
188#	8	Shift + Alt + Control
189#
190# X/Open Curses defines some shift combinations, which are also used here
191# where applicable.  Since it does define some shift combinations, no number
192# (2) is used for suffixing the made-up names.  Some combinations are not
193# useful, e.g., they may reboot your computer, or they may require too many
194# fingers.  I stopped at modifier 7, just to keep things simple -TD
195#
196# XTerm resources:
197# ---------------
198# The xterm+pcfn, xterm+pcf0, xterm+pcf1, xterm+pcf2 and xterm+pcf3 fragments
199# correspond to default resource settings for xterm on a 104-key PC keyboard
200# with 12 function-keys:
201#
202#	*sunKeyboard:false
203#	*oldXtermFKeys:false
204#	*modifyCursorKeys:2
205#	*modifyFunctionKeys:2
206#	*ctrlFKeys:10
207#
208# The key numbers are computed based on the modifiers:
209#
210#	kf1-kf12 are F1-F12
211#	kf13-kf24 are shift F1-F12
212#	kf25-kf36 are control F1-F12
213#	kf37-kf48 are control+shift F1-F12
214#	kf49-kf60 are alt F1-F12
215#	kf61-kf63 are shift-alt F1-F3
216#
217# Note that ncurses would allow definition of kf64 and beyond, if there were
218# an application that required it.
219#
220xterm+pcfkeys|fragment for PC-style keys,
221	use=xterm+app,
222	use=xterm+pcf2,
223	use=xterm+pce2,
224	use=xterm+pcc2,
225
226# This chunk is based on suggestions by Ailin Nemui and Nicholas Marriott, who
227# asked for some of xterm's advanced features to be added to its terminfo
228# entry.  It defines extended capabilities not found in standard terminfo or
229# termcap.  These are useful in tmux, for instance, hence the name.
230#
231# One caveat in adding extended capabilities in ncurses is that if the names
232# are longer than two characters, then they will not be visible through the
233# termcap interface.
234#
235# Ms modifies the selection/clipboard.  Its parameters are
236#	p1 = the storage unit (clipboard, selection or cut buffer)
237#	p2 = the base64-encoded clipboard content.
238#
239# Ss is used to set the cursor style as described by the DECSCUSR
240#	function to a block or underline.
241# Se resets the cursor style to the terminal power-on default.
242#
243# Cs and Ce set and reset the cursor colour.
244xterm+tmux|advanced xterm features used in tmux,
245	Cr=\E]112\007,
246	Cs=\E]12;%p1%s\007,
247	Ms=\E]52;%p1%s;%p2%s
248	   \007,
249	Se=\E[2\sq,
250	Ss=\E[%p1%d\sq,
251#
252# The ctrlFKeys resource is only relevant to the xterm+pcfn and xterm+pcfN
253# entries, since the modifyFunctionKeys resource overrides ctrlFKeys when it is
254# positive.  A different choice of ctrlFKeys would give a different set of
255# function-key strings.
256xterm+pcfn|fragment with modifyFunctionKeys:-1 and ctrlFKeys:10,
257	kf1=\EOP,
258	kf10=\E[21~,
259	kf11=\E[23~,
260	kf12=\E[24~,
261	kf13=\E[25~,
262	kf14=\E[26~,
263	kf15=\E[28~,
264	kf16=\E[29~,
265	kf17=\E[31~,
266	kf18=\E[32~,
267	kf19=\E[33~,
268	kf2=\EOQ,
269	kf20=\E[34~,
270	kf21=\E[42~,
271	kf22=\E[43~,
272	kf23=\E[44~,
273	kf24=\E[45~,
274	kf25=\E[46~,
275	kf26=\E[47~,
276	kf27=\E[48~,
277	kf28=\E[49~,
278	kf29=\E[50~,
279	kf3=\EOR,
280	kf30=\E[51~,
281	kf31=\E[52~,
282	kf32=\E[53~,
283	kf33=\E[54~,
284	kf34=\E[55~,
285	kf35=\E[56~,
286	kf36=\E[57~,
287	kf37=\E[58~,
288	kf38=\E[59~,
289	kf39=\E[60~,
290	kf4=\EOS,
291	kf40=\E[61~,
292	kf41=\E[62~,
293	kf42=\E[63~,
294	kf43=\E[64~,
295	kf44=\E[65~,
296	kf45=\E[66~,
297	kf46=\E[67~,
298	kf47=\E[68~,
299	kf48=\E[69~,
300	kf5=\E[15~,
301	kf6=\E[17~,
302	kf7=\E[18~,
303	kf8=\E[19~,
304	kf9=\E[20~,
305
306# Changing ctrlFKeys to 12 would let us number the keys using just shift- and
307# control- modifiers:
308#	kf1-kf12 are F1-F12
309#	kf13-kf24 are shift F1-F12
310#	kf25-kf36 are control F1-F12
311#	kf37-kf48 are control+shift F1-F12
312xterm+pcfN|fragment with modifyFunctionKeys:-1 and ctrlFKeys:12,
313	kf1=\EOP,
314	kf10=\E[21~,
315	kf11=\E[23~,
316	kf12=\E[24~,
317	kf13=\E[25~,
318	kf14=\E[26~,
319	kf15=\E[28~,
320	kf16=\E[29~,
321	kf17=\E[31~,
322	kf18=\E[32~,
323	kf19=\E[33~,
324	kf2=\EOQ,
325	kf20=\E[34~,
326	kf21=\E[42~,
327	kf22=\E[43~,
328	kf23=\E[44~,
329	kf24=\E[45~,
330	kf25=\E[46~,
331	kf26=\E[47~,
332	kf27=\E[48~,
333	kf28=\E[49~,
334	kf29=\E[50~,
335	kf3=\EOR,
336	kf30=\E[51~,
337	kf31=\E[52~,
338	kf32=\E[53~,
339	kf33=\E[54~,
340	kf34=\E[55~,
341	kf35=\E[56~,
342	kf36=\E[57~,
343	kf37=\E[58~,
344	kf38=\E[59~,
345	kf39=\E[60~,
346	kf4=\EOS,
347	kf40=\E[61~,
348	kf41=\E[62~,
349	kf42=\E[63~,
350	kf43=\E[64~,
351	kf44=\E[65~,
352	kf45=\E[66~,
353	kf46=\E[67~,
354	kf47=\E[68~,
355	kf48=\E[69~,
356	kf5=\E[15~,
357	kf6=\E[17~,
358	kf7=\E[18~,
359	kf8=\E[19~,
360	kf9=\E[20~,
361
362xterm+pcf0|fragment with modifyFunctionKeys:0,
363	kf1=\EOP,
364	kf10=\E[21~,
365	kf11=\E[23~,
366	kf12=\E[24~,
367	kf13=\EO2P,
368	kf14=\EO2Q,
369	kf15=\EO2R,
370	kf16=\EO2S,
371	kf17=\E[15;2~,
372	kf18=\E[17;2~,
373	kf19=\E[18;2~,
374	kf2=\EOQ,
375	kf20=\E[19;2~,
376	kf21=\E[20;2~,
377	kf22=\E[21;2~,
378	kf23=\E[23;2~,
379	kf24=\E[24;2~,
380	kf25=\EO5P,
381	kf26=\EO5Q,
382	kf27=\EO5R,
383	kf28=\EO5S,
384	kf29=\E[15;5~,
385	kf3=\EOR,
386	kf30=\E[17;5~,
387	kf31=\E[18;5~,
388	kf32=\E[19;5~,
389	kf33=\E[20;5~,
390	kf34=\E[21;5~,
391	kf35=\E[23;5~,
392	kf36=\E[24;5~,
393	kf37=\EO6P,
394	kf38=\EO6Q,
395	kf39=\EO6R,
396	kf4=\EOS,
397	kf40=\EO6S,
398	kf41=\E[15;6~,
399	kf42=\E[17;6~,
400	kf43=\E[18;6~,
401	kf44=\E[19;6~,
402	kf45=\E[20;6~,
403	kf46=\E[21;6~,
404	kf47=\E[23;6~,
405	kf48=\E[24;6~,
406	kf49=\EO3P,
407	kf5=\E[15~,
408	kf50=\EO3Q,
409	kf51=\EO3R,
410	kf52=\EO3S,
411	kf53=\E[15;3~,
412	kf54=\E[17;3~,
413	kf55=\E[18;3~,
414	kf56=\E[19;3~,
415	kf57=\E[20;3~,
416	kf58=\E[21;3~,
417	kf59=\E[23;3~,
418	kf6=\E[17~,
419	kf60=\E[24;3~,
420	kf61=\EO4P,
421	kf62=\EO4Q,
422	kf63=\EO4R,
423	kf7=\E[18~,
424	kf8=\E[19~,
425	kf9=\E[20~,
426
427# This is almost the same as xterm+pcf2 because the unmodified keys all happen
428# to have a pattern that forces the modifier to the same position.
429xterm+pcf1|fragment with modifyFunctionKeys:1,
430	kf1=\EOP,
431	kf10=\E[21~,
432	kf11=\E[23~,
433	kf12=\E[24~,
434	kf13=\E[2P,
435	kf14=\E[2Q,
436	kf15=\E[2R,
437	kf16=\E[2S,
438	kf17=\E[15;2~,
439	kf18=\E[17;2~,
440	kf19=\E[18;2~,
441	kf2=\EOQ,
442	kf20=\E[19;2~,
443	kf21=\E[20;2~,
444	kf22=\E[21;2~,
445	kf23=\E[23;2~,
446	kf24=\E[24;2~,
447	kf25=\E[5P,
448	kf26=\E[5Q,
449	kf27=\E[5R,
450	kf28=\E[5S,
451	kf29=\E[15;5~,
452	kf3=\EOR,
453	kf30=\E[17;5~,
454	kf31=\E[18;5~,
455	kf32=\E[19;5~,
456	kf33=\E[20;5~,
457	kf34=\E[21;5~,
458	kf35=\E[23;5~,
459	kf36=\E[24;5~,
460	kf37=\E[6P,
461	kf38=\E[6Q,
462	kf39=\E[6R,
463	kf4=\EOS,
464	kf40=\E[6S,
465	kf41=\E[15;6~,
466	kf42=\E[17;6~,
467	kf43=\E[18;6~,
468	kf44=\E[19;6~,
469	kf45=\E[20;6~,
470	kf46=\E[21;6~,
471	kf47=\E[23;6~,
472	kf48=\E[24;6~,
473	kf49=\E[3P,
474	kf5=\E[15~,
475	kf50=\E[3Q,
476	kf51=\E[3R,
477	kf52=\E[3S,
478	kf53=\E[15;3~,
479	kf54=\E[17;3~,
480	kf55=\E[18;3~,
481	kf56=\E[19;3~,
482	kf57=\E[20;3~,
483	kf58=\E[21;3~,
484	kf59=\E[23;3~,
485	kf6=\E[17~,
486	kf60=\E[24;3~,
487	kf61=\E[4P,
488	kf62=\E[4Q,
489	kf63=\E[4R,
490	kf7=\E[18~,
491	kf8=\E[19~,
492	kf9=\E[20~,
493
494xterm+pcf2|fragment with modifyFunctionKeys:2,
495	kf1=\EOP,
496	kf10=\E[21~,
497	kf11=\E[23~,
498	kf12=\E[24~,
499	kf13=\E[1;2P,
500	kf14=\E[1;2Q,
501	kf15=\E[1;2R,
502	kf16=\E[1;2S,
503	kf17=\E[15;2~,
504	kf18=\E[17;2~,
505	kf19=\E[18;2~,
506	kf2=\EOQ,
507	kf20=\E[19;2~,
508	kf21=\E[20;2~,
509	kf22=\E[21;2~,
510	kf23=\E[23;2~,
511	kf24=\E[24;2~,
512	kf25=\E[1;5P,
513	kf26=\E[1;5Q,
514	kf27=\E[1;5R,
515	kf28=\E[1;5S,
516	kf29=\E[15;5~,
517	kf3=\EOR,
518	kf30=\E[17;5~,
519	kf31=\E[18;5~,
520	kf32=\E[19;5~,
521	kf33=\E[20;5~,
522	kf34=\E[21;5~,
523	kf35=\E[23;5~,
524	kf36=\E[24;5~,
525	kf37=\E[1;6P,
526	kf38=\E[1;6Q,
527	kf39=\E[1;6R,
528	kf4=\EOS,
529	kf40=\E[1;6S,
530	kf41=\E[15;6~,
531	kf42=\E[17;6~,
532	kf43=\E[18;6~,
533	kf44=\E[19;6~,
534	kf45=\E[20;6~,
535	kf46=\E[21;6~,
536	kf47=\E[23;6~,
537	kf48=\E[24;6~,
538	kf49=\E[1;3P,
539	kf5=\E[15~,
540	kf50=\E[1;3Q,
541	kf51=\E[1;3R,
542	kf52=\E[1;3S,
543	kf53=\E[15;3~,
544	kf54=\E[17;3~,
545	kf55=\E[18;3~,
546	kf56=\E[19;3~,
547	kf57=\E[20;3~,
548	kf58=\E[21;3~,
549	kf59=\E[23;3~,
550	kf6=\E[17~,
551	kf60=\E[24;3~,
552	kf61=\E[1;4P,
553	kf62=\E[1;4Q,
554	kf63=\E[1;4R,
555	kf7=\E[18~,
556	kf8=\E[19~,
557	kf9=\E[20~,
558
559xterm+pcf3|fragment with modifyFunctionKeys:3,
560	kf1=\EOP,
561	kf10=\E[21~,
562	kf11=\E[23~,
563	kf12=\E[24~,
564	kf13=\E[>1;2P,
565	kf14=\E[>1;2Q,
566	kf15=\E[>1;2R,
567	kf16=\E[>1;2S,
568	kf17=\E[>15;2~,
569	kf18=\E[>17;2~,
570	kf19=\E[>18;2~,
571	kf2=\EOQ,
572	kf20=\E[>19;2~,
573	kf21=\E[>20;2~,
574	kf22=\E[>21;2~,
575	kf23=\E[>23;2~,
576	kf24=\E[>24;2~,
577	kf25=\E[>1;5P,
578	kf26=\E[>1;5Q,
579	kf27=\E[>1;5R,
580	kf28=\E[>1;5S,
581	kf29=\E[>15;5~,
582	kf3=\EOR,
583	kf30=\E[>17;5~,
584	kf31=\E[>18;5~,
585	kf32=\E[>19;5~,
586	kf33=\E[>20;5~,
587	kf34=\E[>21;5~,
588	kf35=\E[>23;5~,
589	kf36=\E[>24;5~,
590	kf37=\E[>1;6P,
591	kf38=\E[>1;6Q,
592	kf39=\E[>1;6R,
593	kf4=\EOS,
594	kf40=\E[>1;6S,
595	kf41=\E[>15;6~,
596	kf42=\E[>17;6~,
597	kf43=\E[>18;6~,
598	kf44=\E[>19;6~,
599	kf45=\E[>20;6~,
600	kf46=\E[>21;6~,
601	kf47=\E[>23;6~,
602	kf48=\E[>24;6~,
603	kf49=\E[>1;3P,
604	kf5=\E[15~,
605	kf50=\E[>1;3Q,
606	kf51=\E[>1;3R,
607	kf52=\E[>1;3S,
608	kf53=\E[>15;3~,
609	kf54=\E[>17;3~,
610	kf55=\E[>18;3~,
611	kf56=\E[>19;3~,
612	kf57=\E[>20;3~,
613	kf58=\E[>21;3~,
614	kf59=\E[>23;3~,
615	kf6=\E[17~,
616	kf60=\E[>24;3~,
617	kf61=\E[>1;4P,
618	kf62=\E[>1;4Q,
619	kf63=\E[>1;4R,
620	kf7=\E[18~,
621	kf8=\E[19~,
622	kf9=\E[20~,
623#
624# The "PC-style" modifier scheme was introduced in xterm patch #94 (1999/3/27)
625# and revised in patch #167 (2002/8/24).
626#
627# The original assignments from patch #94 for cursor-keys had some technical
628# issues:
629#
630#	A parameter for a function-key to represent a modifier is just more
631#	bits.  But for a cursor-key it may change the behavior of the
632#	application.  For instance, emacs decodes the first parameter of a
633#	cursor-key as a repeat count.
634#
635#	A parameterized string should (really) not begin with SS3 (\EO).
636#	Rather, CSI (\E[) should be used.
637#
638# For these reasons, the original assignments were deprecated.  For
639# compatibility reasons, they are still available as a setting of xterm's
640# modifyCursorKeys resource.  These fragments list the modified cursor-keys
641# that might apply to xterm+pcfkeys with different values of that resource.
642xterm+pcc3|fragment with modifyCursorKeys:3,
643	kLFT=\E[>1;2D,
644	kRIT=\E[>1;2C,
645	kind=\E[>1;2B,
646	kri=\E[>1;2A,
647	kDN=\E[>1;2B,
648	kDN3=\E[>1;3B,
649	kDN4=\E[>1;4B,
650	kDN5=\E[>1;5B,
651	kDN6=\E[>1;6B,
652	kDN7=\E[>1;7B,
653	kLFT3=\E[>1;3D,
654	kLFT4=\E[>1;4D,
655	kLFT5=\E[>1;5D,
656	kLFT6=\E[>1;6D,
657	kLFT7=\E[>1;7D,
658	kRIT3=\E[>1;3C,
659	kRIT4=\E[>1;4C,
660	kRIT5=\E[>1;5C,
661	kRIT6=\E[>1;6C,
662	kRIT7=\E[>1;7C,
663	kUP=\E[>1;2A,
664	kUP3=\E[>1;3A,
665	kUP4=\E[>1;4A,
666	kUP5=\E[>1;5A,
667	kUP6=\E[>1;6A,
668	kUP7=\E[>1;7A,
669
670xterm+pcc2|fragment with modifyCursorKeys:2,
671	kLFT=\E[1;2D,
672	kRIT=\E[1;2C,
673	kind=\E[1;2B,
674	kri=\E[1;2A,
675	kDN=\E[1;2B,
676	kDN3=\E[1;3B,
677	kDN4=\E[1;4B,
678	kDN5=\E[1;5B,
679	kDN6=\E[1;6B,
680	kDN7=\E[1;7B,
681	kLFT3=\E[1;3D,
682	kLFT4=\E[1;4D,
683	kLFT5=\E[1;5D,
684	kLFT6=\E[1;6D,
685	kLFT7=\E[1;7D,
686	kRIT3=\E[1;3C,
687	kRIT4=\E[1;4C,
688	kRIT5=\E[1;5C,
689	kRIT6=\E[1;6C,
690	kRIT7=\E[1;7C,
691	kUP=\E[1;2A,
692	kUP3=\E[1;3A,
693	kUP4=\E[1;4A,
694	kUP5=\E[1;5A,
695	kUP6=\E[1;6A,
696	kUP7=\E[1;7A,
697
698xterm+pcc1|fragment with modifyCursorKeys:1,
699	kLFT=\E[2D,
700	kRIT=\E[2C,
701	kind=\E[2B,
702	kri=\E[2A,
703	kDN=\E[2B,
704	kDN3=\E[3B,
705	kDN4=\E[4B,
706	kDN5=\E[5B,
707	kDN6=\E[6B,
708	kDN7=\E[7B,
709	kLFT3=\E[3D,
710	kLFT4=\E[4D,
711	kLFT5=\E[5D,
712	kLFT6=\E[6D,
713	kLFT7=\E[7D,
714	kRIT3=\E[3C,
715	kRIT4=\E[4C,
716	kRIT5=\E[5C,
717	kRIT6=\E[6C,
718	kRIT7=\E[7C,
719	kUP=\E[2A,
720	kUP3=\E[3A,
721	kUP4=\E[4A,
722	kUP5=\E[5A,
723	kUP6=\E[6A,
724	kUP7=\E[7A,
725
726xterm+pcc0|fragment with modifyCursorKeys:0,
727	kLFT=\EO2D,
728	kRIT=\EO2C,
729	kind=\EO2B,
730	kri=\EO2A,
731	kDN=\EO2B,
732	kDN3=\EO3B,
733	kDN4=\EO4B,
734	kDN5=\EO5B,
735	kDN6=\EO6B,
736	kDN7=\EO7B,
737	kLFT3=\EO3D,
738	kLFT4=\EO4D,
739	kLFT5=\EO5D,
740	kLFT6=\EO6D,
741	kLFT7=\EO7D,
742	kRIT3=\EO3C,
743	kRIT4=\EO4C,
744	kRIT5=\EO5C,
745	kRIT6=\EO6C,
746	kRIT7=\EO7C,
747	kUP=\EO2A,
748	kUP3=\EO3A,
749	kUP4=\EO4A,
750	kUP5=\EO5A,
751	kUP6=\EO6A,
752	kUP7=\EO7A,
753
754# The home/end keys on the editing keypad are also treated as cursor keys.
755xterm+pce3|fragment with modifyCursorKeys:3,
756	kDC=\E[>3;2~,
757	kEND=\E[>1;2F,
758	kHOM=\E[>1;2H,
759	kIC=\E[>2;2~,
760	kNXT=\E[>6;2~,
761	kPRV=\E[>5;2~,
762	kDC3=\E[>3;3~,
763	kDC4=\E[>3;4~,
764	kDC5=\E[>3;5~,
765	kDC6=\E[>3;6~,
766	kDC7=\E[>3;7~,
767	kEND3=\E[>1;3F,
768	kEND4=\E[>1;4F,
769	kEND5=\E[>1;5F,
770	kEND6=\E[>1;6F,
771	kEND7=\E[>1;7F,
772	kHOM3=\E[>1;3H,
773	kHOM4=\E[>1;4H,
774	kHOM5=\E[>1;5H,
775	kHOM6=\E[>1;6H,
776	kHOM7=\E[>1;7H,
777	kIC3=\E[>2;3~,
778	kIC4=\E[>2;4~,
779	kIC5=\E[>2;5~,
780	kIC6=\E[>2;6~,
781	kIC7=\E[>2;7~,
782	kNXT3=\E[>6;3~,
783	kNXT4=\E[>6;4~,
784	kNXT5=\E[>6;5~,
785	kNXT6=\E[>6;6~,
786	kNXT7=\E[>6;7~,
787	kPRV3=\E[>5;3~,
788	kPRV4=\E[>5;4~,
789	kPRV5=\E[>5;5~,
790	kPRV6=\E[>5;6~,
791	kPRV7=\E[>5;7~,
792	use=xterm+pce0,
793
794xterm+pce2|fragment with modifyCursorKeys:2,
795	kDC=\E[3;2~,
796	kEND=\E[1;2F,
797	kHOM=\E[1;2H,
798	kIC=\E[2;2~,
799	kNXT=\E[6;2~,
800	kPRV=\E[5;2~,
801	kDC3=\E[3;3~,
802	kDC4=\E[3;4~,
803	kDC5=\E[3;5~,
804	kDC6=\E[3;6~,
805	kDC7=\E[3;7~,
806	kEND3=\E[1;3F,
807	kEND4=\E[1;4F,
808	kEND5=\E[1;5F,
809	kEND6=\E[1;6F,
810	kEND7=\E[1;7F,
811	kHOM3=\E[1;3H,
812	kHOM4=\E[1;4H,
813	kHOM5=\E[1;5H,
814	kHOM6=\E[1;6H,
815	kHOM7=\E[1;7H,
816	kIC3=\E[2;3~,
817	kIC4=\E[2;4~,
818	kIC5=\E[2;5~,
819	kIC6=\E[2;6~,
820	kIC7=\E[2;7~,
821	kNXT3=\E[6;3~,
822	kNXT4=\E[6;4~,
823	kNXT5=\E[6;5~,
824	kNXT6=\E[6;6~,
825	kNXT7=\E[6;7~,
826	kPRV3=\E[5;3~,
827	kPRV4=\E[5;4~,
828	kPRV5=\E[5;5~,
829	kPRV6=\E[5;6~,
830	kPRV7=\E[5;7~,
831	use=xterm+pce0,
832
833xterm+pce1|fragment with modifyCursorKeys:1,
834	kDC=\E[3;2~,
835	kEND=\E[2F,
836	kHOM=\E[2H,
837	kIC=\E[2;2~,
838	kNXT=\E[6;2~,
839	kPRV=\E[5;2~,
840	kDC3=\E[3;3~,
841	kDC4=\E[3;4~,
842	kDC5=\E[3;5~,
843	kDC6=\E[3;6~,
844	kDC7=\E[3;7~,
845	kEND3=\E[3F,
846	kEND4=\E[4F,
847	kEND5=\E[5F,
848	kEND6=\E[6F,
849	kEND7=\E[7F,
850	kHOM3=\E[3H,
851	kHOM4=\E[4H,
852	kHOM5=\E[5H,
853	kHOM6=\E[6H,
854	kHOM7=\E[7H,
855	kIC3=\E[2;3~,
856	kIC4=\E[2;4~,
857	kIC5=\E[2;5~,
858	kIC6=\E[2;6~,
859	kIC7=\E[2;7~,
860	kNXT3=\E[6;3~,
861	kNXT4=\E[6;4~,
862	kNXT5=\E[6;5~,
863	kNXT6=\E[6;6~,
864	kNXT7=\E[6;7~,
865	kPRV3=\E[5;3~,
866	kPRV4=\E[5;4~,
867	kPRV5=\E[5;5~,
868	kPRV6=\E[5;6~,
869	kPRV7=\E[5;7~,
870	use=xterm+pce0,
871
872xterm+pce0|fragment with modifyCursorKeys:0,
873	kDC=\E[3;2~,
874	kEND=\EO2F,
875	kHOM=\EO2H,
876	kIC=\E[2;2~,
877	kNXT=\E[6;2~,
878	kPRV=\E[5;2~,
879	kDC3=\E[3;3~,
880	kDC4=\E[3;4~,
881	kDC5=\E[3;5~,
882	kDC6=\E[3;6~,
883	kDC7=\E[3;7~,
884	kEND3=\EO3F,
885	kEND4=\EO4F,
886	kEND5=\EO5F,
887	kEND6=\EO6F,
888	kEND7=\EO7F,
889	kHOM3=\EO3H,
890	kHOM4=\EO4H,
891	kHOM5=\EO5H,
892	kHOM6=\EO6H,
893	kHOM7=\EO7H,
894	kIC3=\E[2;3~,
895	kIC4=\E[2;4~,
896	kIC5=\E[2;5~,
897	kIC6=\E[2;6~,
898	kIC7=\E[2;7~,
899	kNXT3=\E[6;3~,
900	kNXT4=\E[6;4~,
901	kNXT5=\E[6;5~,
902	kNXT6=\E[6;6~,
903	kNXT7=\E[6;7~,
904	kPRV3=\E[5;3~,
905	kPRV4=\E[5;4~,
906	kPRV5=\E[5;5~,
907	kPRV6=\E[5;6~,
908	kPRV7=\E[5;7~,
909	use=xterm+edit,
910
911ecma+italics|ECMA-48 italics,
912	ritm=\E[23m,
913	sitm=\E[3m,
914
915# The rmxx/smxx capabilities are an ncurses extension
916ecma+strikeout|ECMA-48 strikeout/crossed-out,
917	rmxx=\E[29m,
918	smxx=\E[9m,
919
920# ECMA-48 does not include the VT100 indexing and scroll-margins.  It has its
921# own variation.
922ecma+index|ECMA-48 scroll up/down,
923	indn=\E[%p1%dS,
924	rin=\E[%p1%dT,
925
926# The XM capability is an ncurses extension
927xterm+sm+1006|xterm SGR-mouse,
928	kmous=\E[<,
929	XM=\E[?1006;1000
930		%?
931			%p1%{1}%=
932			%th
933		%e
934			l
935		%;,
936	xm=\E[<%i
937		%p3%d;
938		%p1%d;
939		%p2%d;
940		%?
941			%p4
942			%tM
943		%e
944			m
945		%;,
946
947# By default, ncurses knows that xterm private mode 1000 enables/disables
948# the X11 xterm mouse protocol.  So XM is not needed here, except for clarity.
949xterm+x11mouse|X11 xterm mouse protocol,
950	kmous=\E[M,
951	XM=\E[?1000
952		%?
953			%p1%{1}%=
954			%th
955		%e
956			l
957		%;,
958	xm=\E[M
959		%?
960			%p4
961			%t
962			%p3
963		%e%{3}
964		%;
965		%'\s'%+%c
966		%p2%'!'%+%c
967		%p1%'!'%+%c,
968
969# This chunk is used for building the VT220/Sun/PC keyboard variants.
970xterm-basic|modern xterm terminal emulator - common,
971	OTbs,
972	am,
973	bce,
974	km,
975	mc5i,
976	mir,
977	msgr,
978	xenl,
979	AX,
980	XT,
981	colors#8,
982	cols#80,
983	it#8,
984	lines#24,
985	pairs#64,
986	acsc=``aaffggiijjkkllmmnnooppqqr
987	     rssttuuvvwwxxyyzz{{||}}~~,
988	bel=^G,
989	blink=\E[5m,
990	bold=\E[1m,
991	cbt=\E[Z,
992	civis=\E[?25l,
993	clear=\E[H\E[2J,
994	cnorm=\E[?12l\E[?25h,
995	cr=\r,
996	csr=\E[%i%p1%d;%p2%dr,
997	cub=\E[%p1%dD,
998	cub1=^H,
999	cud=\E[%p1%dB,
1000	cud1=\n,
1001	cuf=\E[%p1%dC,
1002	cuf1=\E[C,
1003	cup=\E[%i%p1%d;%p2%dH,
1004	cuu=\E[%p1%dA,
1005	cuu1=\E[A,
1006	cvvis=\E[?12;25h,
1007	dch=\E[%p1%dP,
1008	dch1=\E[P,
1009	dim=\E[2m,
1010	dl=\E[%p1%dM,
1011	dl1=\E[M,
1012	ech=\E[%p1%dX,
1013	ed=\E[J,
1014	el=\E[K,
1015	el1=\E[1K,
1016	flash=\E[?5h$<100/>\E[?5l,
1017	home=\E[H,
1018	hpa=\E[%i%p1%dG,
1019	ht=^I,
1020	hts=\EH,
1021	ich=\E[%p1%d@,
1022	il=\E[%p1%dL,
1023	il1=\E[L,
1024	ind=\n,
1025	invis=\E[8m,
1026	is2=\E[!p\E[?3;4l\E[4l\E>,
1027	kmous=\E[M,
1028	mc0=\E[i,
1029	mc4=\E[4i,
1030	mc5=\E[5i,
1031	meml=\El,
1032	memu=\Em,
1033	op=\E[39;49m,
1034	rc=\E8,
1035	rev=\E[7m,
1036	ri=\EM,
1037	rmacs=\E(B,
1038	rmam=\E[?7l,
1039	rmir=\E[4l,
1040	rmkx=\E[?1l\E>,
1041	rmm=\E[?1034l,
1042	rmso=\E[27m,
1043	rmul=\E[24m,
1044	rs1=\Ec,
1045	rs2=\E[!p\E[?3;4l\E[4l\E>,
1046	sc=\E7,
1047	setab=\E[4%p1%dm,
1048	setaf=\E[3%p1%dm,
1049	setb=\E[4
1050		%?
1051			%p1%{1}%=
1052			%t4
1053		%e
1054			%p1%{3}%=
1055			%t6
1056		%e
1057			%p1%{4}%=
1058			%t1
1059		%e
1060			%p1%{6}%=
1061			%t3
1062		%e
1063			%p1%d
1064		%;
1065		m,
1066	setf=\E[3
1067		%?
1068			%p1%{1}%=
1069			%t4
1070		%e
1071			%p1%{3}%=
1072			%t6
1073		%e
1074			%p1%{4}%=
1075			%t1
1076		%e
1077			%p1%{6}%=
1078			%t3
1079		%e
1080			%p1%d
1081		%;
1082		m,
1083	sgr=
1084		%?
1085			%p9
1086			%t\E(0
1087		%e
1088			\E(B
1089		%;
1090		\E[0
1091		%?
1092			%p6
1093			%t;1
1094		%;
1095		%?
1096			%p5
1097			%t;2
1098		%;
1099		%?
1100			%p2
1101			%t;4
1102		%;
1103		%?
1104			%p1
1105			%p3%|
1106			%t;7
1107		%;
1108		%?
1109			%p4
1110			%t;5
1111		%;
1112		%?
1113			%p7
1114			%t;8
1115		%;
1116		m,
1117	sgr0=\E(B\E[m,
1118	smacs=\E(0,
1119	smam=\E[?7h,
1120	smir=\E[4h,
1121	smkx=\E[?1h\E=,
1122	smm=\E[?1034h,
1123	smso=\E[7m,
1124	smul=\E[4m,
1125	tbc=\E[3g,
1126	vpa=\E[%i%p1%dd,
1127	E3=\E[3J,
1128	use=ansi+enq,
1129	use=xterm+alt+title,
1130	use=xterm+kbs,
1131
1132xterm+nofkeys|building block for xterm fkey-variants,
1133	npc,
1134	kcbt=\E[Z,
1135	kent=\EOM,
1136	nel=\EE,
1137	use=ecma+index,
1138	use=ansi+rep,
1139	use=ecma+strikeout,
1140	use=vt420+lrmm,
1141	use=xterm+sm+1006,
1142	use=xterm+tmux,
1143	use=ecma+italics,
1144	use=xterm+keypad,
1145	use=xterm-basic,
1146#
1147# The xterm-new description has all of the features, but is not completely
1148# compatible with vt220.  If you are using a Sun or PC keyboard, set the
1149# sunKeyboard resource to true:
1150#	+ maps the editing keypad
1151#	+ interprets control-function-key as a second array of keys, so a
1152#	  12-fkey keyboard can support vt220's 20-fkeys.
1153#	+ maps numeric keypad "+" to ",".
1154#	+ uses DEC-style control sequences for the application keypad.
1155#
1156# Some packagers modify xterm's resource definitions to provide extra function
1157# keys by using the shift-modifier in the translations resource.  However, that
1158# interferes with the DECUDK functionality.
1159#
1160xterm-vt220|xterm emulating vt220,
1161	npc,
1162	kcbt=\E[Z,
1163	kcub1=\EOD,
1164	kcud1=\EOB,
1165	kcuf1=\EOC,
1166	kcuu1=\EOA,
1167	kend=\E[4~,
1168	kent=\EOM,
1169	kf10=\E[21~,
1170	kf11=\E[23~,
1171	kf12=\E[24~,
1172	kf13=\E[25~,
1173	kf14=\E[26~,
1174	kf15=\E[28~,
1175	kf16=\E[29~,
1176	kf17=\E[31~,
1177	kf18=\E[32~,
1178	kf19=\E[33~,
1179	kf20=\E[34~,
1180	kf5=\E[15~,
1181	kf6=\E[17~,
1182	kf7=\E[18~,
1183	kf8=\E[19~,
1184	kf9=\E[20~,
1185	khome=\E[1~,
1186	kich1=\E[2~,
1187	kmous=\E[M,
1188	knp=\E[6~,
1189	kpp=\E[5~,
1190	nel=\EE,
1191	use=xterm+app,
1192	use=xterm+edit,
1193	use=vt220+keypad,
1194	use=ecma+italics,
1195	use=ecma+index,
1196	use=ansi+rep,
1197	use=ecma+strikeout,
1198	use=xterm+sm+1006,
1199	use=xterm+tmux,
1200	use=xterm+keypad,
1201	use=xterm-basic,
1202#
1203xterm-vt52|xterm emulating dec vt52,
1204	cols#80,
1205	it#8,
1206	lines#24,
1207	acsc=``aaffggjjkkllmmnnooppqqrrs
1208	     sttuuvvwwxxyyzz{{||}}~~,
1209	bel=^G,
1210	clear=\EH\EJ,
1211	cr=\r,
1212	cub1=\ED,
1213	cud1=\EB,
1214	cuf1=\EC,
1215	cup=\EY%p1%'\s'%+%c%p2%'\s'%+%c,
1216	cuu1=\EA,
1217	ed=\EJ,
1218	el=\EK,
1219	home=\EH,
1220	ht=^I,
1221	ind=\n,
1222	kcub1=\ED,
1223	kcud1=\EB,
1224	kcuf1=\EC,
1225	kcuu1=\EA,
1226	nel=\r\n,
1227	ri=\EI,
1228	rmacs=\EG,
1229	smacs=\EF,
1230	use=xterm+kbs,
1231	use=vt52+keypad,
1232
1233# from ncurses 6.2:
1234# DECScope of course had no "function keys", but this building block assigns
1235# the three blank keys at the top of the auxiliary (numeric) keypad, using
1236# the same analogy as vt100 (also lacking function-keys).
1237#
1238# These assignments use the same layout for 0-9 as vt100+keypad; the vt52
1239# keypad had its cursor-keys on the right-column as shown -TD
1240#   _______________________________________
1241#  |   PF1   |   PF2   |   PF3   | c-up    |
1242#  |   \EP   |   \EQ   |   \ER   |   \EA   |
1243#  |_kf1__k1_|_kf2__k2_|_kf3__k3_|kcuu1_k4_|
1244#  |    7         8         9      c-down  |
1245#  |   \E?w  |   \E?x  |   \E?y  |   \EB   |
1246#  |_kf9__k9_|_kf10_k;_|_kf0__k0_|kcud1____|
1247#  |    4    |    5    |    6    | c-right |
1248#  |   \E?t  |   \E?u  |   \E?v  |   \EC   |
1249#  |_kf5__k5_|_kf6__k6_|_kf7__k7_|kcuf1_k8_|
1250#  |    1    |    2    |    3    | c-left  |
1251#  |   \E?q  |   \E?r  |   \E?s  |   \ED   |
1252#  |_ka1__K1_|_kb2__K2_|_ka3__K3_|kcub1____|
1253#  |         0         |   .     |  enter  |
1254#  |        \E?p       |  \E?n   |  \E?M   |
1255#  |___kc1_______K4____|_kc3__K5_|_kent_@8_|
1256#
1257vt52+keypad|DECScope auxiliary keypad,
1258	ka1=\E?q,
1259	ka3=\E?s,
1260	kb2=\E?r,
1261	kc1=\E?p,
1262	kc3=\E?n,
1263	kf0=\E?y,
1264	kf1=\EP,
1265	kf2=\EQ,
1266	kf3=\ER,
1267	kf5=\E?t,
1268	kf6=\E?u,
1269	kf7=\E?v,
1270	kf8=\E?w,
1271	kf9=\E?x,
1272#
1273# Sun does not number the function keys this way in their sparse termcap; their
1274# terminal descriptions ignore the keypads.  kb(7M) states that there are codes
1275# reserved for 64 function keys, 16 each in left, right, top and bottom.  Each
1276# keyboard type has a different number of function keys in different
1277# arrangements.  Using xkeycaps for reference:
1278#
1279# Type 3:  left 10, top 9, right 15
1280# ------
1281# kf1-kf9 are XK_F1-XK_F9
1282# There is no kf10 on this keyboard type.
1283# kf11-kf20 are keysyms XK_L1 through XK_L10.
1284# kf31-kf45 are keysyms XK_R1 through XK_R15.
1285#
1286# However, X's keysymdef.h is hard-coded to make
1287#	XK_L1==XK_F11 and
1288#	XK_R1==XK_F21,
1289# by someone who was unfamiliar with terminal types other than Sun's.  So
1290# xterm uses the internal X keysymbols, but the terminfo entry uses the Sun
1291# numbering scheme.
1292#
1293# Type 4:  left 11, top 12, right 15
1294# ------
1295# The left-keypad contains an unnumbered Help-key.
1296# The right-keypad also contains NumLock, Ins, Del, Enter, + and - keys which
1297# do not appear to be part of the R-sequence.
1298#
1299# Type 5:  left 9, top 12, right (more than one keypad)
1300# ------
1301# These keyboards do not use the same naming convention, look like a hybrid of
1302# the type 4 and IBM keyboards.
1303#
1304# XTerm resources:
1305# ---------------
1306# Set the modifyFunctionKeys resource to negative (-1) to make it simple to
1307# enter the higher function-key values using shift- and control-modifiers.
1308#
1309xterm-sun|xterm with sun function keys,
1310	kb2=\E[218z,
1311	kcpy=\E[197z,
1312	kcub1=\EOD,
1313	kcud1=\EOB,
1314	kcuf1=\EOC,
1315	kcuu1=\EOA,
1316	kdch1=\E[3z,
1317	kend=\E[220z,
1318	kent=\EOM,
1319	kf1=\E[224z,
1320	kf10=\E[233z,
1321	kf11=\E[192z,
1322	kf12=\E[193z,
1323	kf13=\E[194z,
1324	kf14=\E[195z,
1325	kf15=\E[196z,
1326	kf17=\E[198z,
1327	kf18=\E[199z,
1328	kf19=\E[200z,
1329	kf2=\E[225z,
1330	kf20=\E[201z,
1331	kf3=\E[226z,
1332	kf31=\E[208z,
1333	kf32=\E[209z,
1334	kf33=\E[210z,
1335	kf34=\E[211z,
1336	kf35=\E[212z,
1337	kf36=\E[213z,
1338	kf38=\E[215z,
1339	kf4=\E[227z,
1340	kf40=\E[217z,
1341	kf42=\E[219z,
1342	kf44=\E[221z,
1343	kf45=\E[222z,
1344	kf46=\E[234z,
1345	kf47=\E[235z,
1346	kf5=\E[228z,
1347	kf6=\E[229z,
1348	kf7=\E[230z,
1349	kf8=\E[231z,
1350	kf9=\E[232z,
1351	kfnd=\E[200z,
1352	khlp=\E[196z,
1353	khome=\E[214z,
1354	kich1=\E[2z,
1355	knp=\E[222z,
1356	kpp=\E[216z,
1357	kund=\E[195z,
1358	use=xterm+nopcfkeys,
1359	use=xterm+nofkeys,
1360
1361# Note: normally xterm supports modified function-keys as described in
1362#	XTerm - "Other" modified keys
1363#	https://invisible-island.net/xterm/modified-keys.html
1364#
1365# However, xterm-hp, xterm-sco and xterm-sun assume no modifiers.  Here is
1366# a simple script which demonstrates these descriptions:
1367#	#!/bin/sh
1368#	export TERM=xterm-$1
1369#	xterm \
1370#		-kt $1 \
1371#		-fs 16 -fa mono \
1372#		-title $TERM \
1373#		-tn $TERM \
1374#		-xrm '*modifyCursorKeys:-1' \
1375#		-xrm '*modifyFunctionKeys:-1' \
1376#		-e tack
1377# e.g., "foo sun" if the script is named "foo" -TD
1378
1379xterm-hp|xterm with hpterm function keys,
1380	kclr=\EJ,
1381	kcub1=\ED,
1382	kcud1=\EB,
1383	kcuf1=\EC,
1384	kcuu1=\EA,
1385	kdch1=\EP,
1386	kend=\EF,
1387	kf1=\Ep,
1388	kf2=\Eq,
1389	kf3=\Er,
1390	kf4=\Es,
1391	kf5=\Et,
1392	kf6=\Eu,
1393	kf7=\Ev,
1394	kf8=\Ew,
1395	khome=\Eh,
1396	kich1=\EQ,
1397	knp=\ES,
1398	kpp=\ET,
1399	use=xterm+nofkeys,
1400	use=xterm+nopcfkeys,
1401#
1402# scoterm implements 48 function-keys using shift- and control-modifiers to
1403# multiple 12 function-keys.  X has a hard-coded limit of 35 function-keys,
1404# but xterm can represent larger values.
1405#
1406# XTerm resources:
1407# ---------------
1408# Set the modifyFunctionKeys resource to negative (-1) to make it simple to
1409# enter the higher function-key values using shift- and control-modifiers.
1410#
1411# Also, set ctrlFKeys resource to 12 (the default is 10) to make xterm see 48
1412# function-keys on a keyboard with 12 function-keys and 4 control/shift
1413# modifier combinations.
1414#
1415xterm-sco|xterm with SCO function keys,
1416	kbeg=\E[E,
1417	kdch1=^?,
1418	kf1=\E[M,
1419	kf10=\E[V,
1420	kf11=\E[W,
1421	kf12=\E[X,
1422	kf13=\E[Y,
1423	kf14=\E[Z,
1424	kf15=\E[a,
1425	kf16=\E[b,
1426	kf17=\E[c,
1427	kf18=\E[d,
1428	kf19=\E[e,
1429	kf2=\E[N,
1430	kf20=\E[f,
1431	kf21=\E[g,
1432	kf22=\E[h,
1433	kf23=\E[i,
1434	kf24=\E[j,
1435	kf25=\E[k,
1436	kf26=\E[l,
1437	kf27=\E[m,
1438	kf28=\E[n,
1439	kf29=\E[o,
1440	kf3=\E[O,
1441	kf30=\E[p,
1442	kf31=\E[q,
1443	kf32=\E[r,
1444	kf33=\E[s,
1445	kf34=\E[t,
1446	kf35=\E[u,
1447	kf36=\E[v,
1448	kf37=\E[w,
1449	kf38=\E[x,
1450	kf39=\E[y,
1451	kf4=\E[P,
1452	kf40=\E[z,
1453	kf41=\E[@,
1454	kf42=\E[[,
1455	kf43=\E[\\,
1456	kf44=\E[],
1457	kf45=\E[\^,
1458	kf46=\E[_,
1459	kf47=\E[`,
1460	kf48=\E[{,
1461	kf5=\E[Q,
1462	kf6=\E[R,
1463	kf7=\E[S,
1464	kf8=\E[T,
1465	kf9=\E[U,
1466	kich1=\E[L,
1467	kmous=\E[>M,
1468	knp=\E[G,
1469	kpp=\E[I,
1470	use=xterm+noapp,
1471	use=xterm+nofkeys,
1472#
1473# Other variants (these are all very old entries, from X11R5):
1474xterm-24|xterms|vs100|xterm terminal emulator (X Window System),
1475	lines#24,
1476	use=xterm-old,
1477xterm-65|xterm with tall window 65x80 (X Window System),
1478	lines#65,
1479	use=xterm-old,
1480xterm-bold|xterm with bold instead of underline (X Window System),
1481	sgr=
1482		%?
1483			%p9
1484			%t\016
1485		%e
1486			\017
1487		%;
1488		B\E[0
1489		%?
1490			%p6
1491			%t;1
1492		%;
1493		%?
1494			%p2
1495			%t;1
1496		%;
1497		%?
1498			%p1
1499			%p3%|
1500			%t;7
1501		%;
1502		m,
1503	smso=\E[7m,
1504	smul=\E[1m,
1505	use=xterm-old,
1506xterm-boldso|xterm with bold for standout (X Window System),
1507	rmso=\E[m,
1508	smso=\E[1m,
1509	use=xterm-old,
1510xterm-mono|monochrome xterm,
1511	use=xterm-old,
1512#
1513# VTxxx terminals are usually set up so that full-screen applications will use
1514# the cursor application mode strings.  This is good for full-screen
1515# applications, including legacy applications which may have hard-coded
1516# behavior, but bad for interactive shells (e.g., tcsh, bash) which use arrow
1517# keys to scroll through a history of command strings.
1518#
1519# To see the difference between normal/application modes, consider this example:
1520#	+ In normal (non-application) mode, the terminal transmits a down-arrow
1521#	  as \E[C, which happens to echo as a down-arrow.
1522#	+ In application mode the terminal transmits \EOC, which echoes as C.
1523#	  That is because the \EO is the SS3 control, which says to use the
1524#	  character from the G3 character set for the next cell.
1525#
1526# One example of hard-coded behavior would be for applications written to work
1527# with VT52 and VT100 terminals.  If the application's parser ignores 'O' and
1528# '?' characters after the escape, then the cursor and keypad strings for the
1529# two terminals are the same.  (Indeed, one of the first curses applications
1530# which I used did something like this to cover "ANSI" terminals -TD).
1531#
1532# To make this work (leaving the cursor keys in normal mode), we have to adjust
1533# the terminal initialization sequences:
1534#
1535#	smkx/rmkx set/reset the cursor and keypad application modes.  We retain
1536#		the latter (otherwise many applications fail).
1537#
1538#	smcup/rmcup set/restore cursor-addressing mode for full-screen
1539#		applications.  For xterm, this normally means the alternate
1540#		screen, which is not compatible with interactive shells.  Some
1541#		programs are "smart" and disable these.
1542#
1543xterm-noapp|xterm with cursor keys in normal mode,
1544	rmcup@,
1545	rmkx=\E>,
1546	smcup@,
1547	smkx=\E=,
1548	use=xterm+noapp,
1549	use=xterm,
1550
1551xterm+noapp|fragment with cursor keys in normal mode,
1552	kcub1=\E[D,
1553	kcud1=\E[B,
1554	kcuf1=\E[C,
1555	kcuu1=\E[A,
1556	use=xterm+noapp+pc,
1557
1558xterm+app|fragment with cursor keys in application mode,
1559	kcub1=\EOD,
1560	kcud1=\EOB,
1561	kcuf1=\EOC,
1562	kcuu1=\EOA,
1563	use=xterm+app+pc,
1564
1565xterm+noapp+pc|fragment for noapp pc-style home/end,
1566	kend=\E[F,
1567	khome=\E[H,
1568
1569xterm+app+pc|fragment for app pc-style home/end,
1570	kend=\EOF,
1571	khome=\EOH,
1572
1573xterm+edit|fragment for 6-key editing-keypad,
1574	kdch1=\E[3~,
1575	kich1=\E[2~,
1576	knp=\E[6~,
1577	kpp=\E[5~,
1578	use=xterm+pc+edit,
1579
1580xterm+decedit|fragment for vt220 6-key editing-keypad,
1581	kdch1=\E[3~,
1582	kich1=\E[2~,
1583	knp=\E[6~,
1584	kpp=\E[5~,
1585	use=xterm+vt+edit,
1586
1587xterm+pc+edit|fragment for pc-style editing keypad,
1588	kend=\E[4~,
1589	khome=\E[1~,
1590
1591xterm+vt+edit|fragment for vt220-style editing keypad,
1592	kfnd=\E[1~,
1593	kslt=\E[4~,
1594
1595xterm+noalt|xterm without altscreen,
1596	rmcup@,
1597	smcup@,
1598
1599xterm+alt1049|xterm 90 feature,
1600	rmcup=\E[?1049l,
1601	smcup=\E[?1049h,
1602
1603xterm+titlestack|xterm 251 feature,
1604	rmcup=\E[23;0;0t,
1605	smcup=\E[22;0;0t,
1606
1607xterm+alt+title|xterm 90 and 251 features combined,
1608	rmcup=\E[?1049l\E[23;0;0t,
1609	smcup=\E[?1049h\E[22;0;0t,
1610
1611# The xterm ctrlFKeys resource defaults to 10, so without the "pc-style"
1612# feature, e.g., setting the modifyCursorKeys and modifyFunctionKeys resources
1613# to -1 to disable them, one gets 42 function-keys on a 12-function-key
1614# keyboard, e.g.,
1615# kf1                   = \E[11~
1616# kf11 shift f1         = \E[23~
1617# kf21 control f1       = \E[42~
1618# kf31 shift control f1 = \E[52~
1619xterm+nopcfkeys|fragment without PC-style fkeys,
1620	kf1=\E[11~,
1621	kf10=\E[21~,
1622	kf11=\E[23~,
1623	kf12=\E[24~,
1624	kf13=\E[25~,
1625	kf14=\E[26~,
1626	kf15=\E[28~,
1627	kf16=\E[29~,
1628	kf17=\E[31~,
1629	kf18=\E[32~,
1630	kf19=\E[33~,
1631	kf2=\E[12~,
1632	kf20=\E[34~,
1633	kf21=\E[42~,
1634	kf22=\E[43~,
1635	kf23=\E[44~,
1636	kf24=\E[45~,
1637	kf25=\E[46~,
1638	kf26=\E[47~,
1639	kf27=\E[48~,
1640	kf28=\E[49~,
1641	kf29=\E[50~,
1642	kf3=\E[13~,
1643	kf30=\E[51~,
1644	kf31=\E[52~,
1645	kf32=\E[53~,
1646	kf33=\E[54~,
1647	kf34=\E[55~,
1648	kf35=\E[56~,
1649	kf36=\E[57~,
1650	kf37=\E[58~,
1651	kf38=\E[59~,
1652	kf39=\E[60~,
1653	kf4=\E[14~,
1654	kf40=\E[61~,
1655	kf41=\E[62~,
1656	kf42=\E[63~,
1657	kf5=\E[15~,
1658	kf6=\E[17~,
1659	kf7=\E[18~,
1660	kf8=\E[19~,
1661	kf9=\E[20~,
1662
1663# from development after ncurses 6.1:
1664# Xterm's emulation of the VT100 numeric keypad on a PC-keyboard runs into the
1665# problem that the keypad layout is different, and that the natural choice for
1666# PF1 is NumLock (which happens to be reserved for other use).  To work around
1667# that, PF1-PF4 are emulated via F1-F4, which leaves the "/", "*" and "+" not
1668# directly related to VT100.
1669#
1670# With the VT220 keypad block that uses the 1-9 keys as suggested in
1671# terminfo(5), the other keys can be handled with user-defined capabilities:
1672#
1673#   _______________________________________
1674#  | NumLock |    /    |    *    |    -    |
1675#  |         |   $Oo   |   $Oj   |   $OS   |
1676#  |_________|__kpDIV__|__kpMUL__|__kpSUB__|
1677#  |    7         8         9    |    +    |
1678#  |   $Ow   |   $Ox   |   $Oy   |   $Ok   |
1679#  |_ka1__K1_|_________|_ka3__K3_|  kpADD  |
1680#  |    4    |    5    |    6    |         |
1681#  |   $Ot   |   $Ou   |   $Ov   |         |
1682#  |_________|_kb2__K2_|_________|_________|
1683#  |    1    |    2    |    3    |         |
1684#  |   $Oq   |   $Or   |   $Os   |         |
1685#  |_kc1__K4_|_________|_kc3__K5_|  enter  |
1686#  |         0         |    .    |   $OM   |
1687#  |        $Op        |   $On   |         |
1688#  |_______kpZRO_______|__kpDOT__|_kent_@8_|
1689#
1690# ka2, kb1, kb3 and kc2 are extensions, as are the mixed-case names.
1691# There are no termcap equivalents for these extensions.
1692#
1693# kpCMA (comma) is used here for the VT100 keypad, which xterm emulates with
1694# shifted-keypad-plus, though normally that invokes a font-size change.
1695#
1696# Old versions of xterm, e.g., xterm-xfree86, documented \EOE as kb2, which
1697# does not fit into this layout.  The extension kp5 fits, but is not visible
1698# to termcap applications.  As an alternative, kbeg (which does have a termcap
1699# equivalent) is provided.
1700
1701xterm+keypad|xterm emulating VT100/VT220 numeric keypad,
1702	kbeg=\EOE,
1703	kp5=\EOE,
1704	kpADD=\EOk,
1705	kpCMA=\EOl,
1706	kpDIV=\EOo,
1707	kpDOT=\EOn,
1708	kpMUL=\EOj,
1709	kpSUB=\EOm,
1710	kpZRO=\EOp,
1711	use=vt220+keypad,
1712
1713# from development after ncurses 5.2:
1714# A better adaptation to modern keyboards such as the PC's, which have a dozen
1715# function keys and the keypad 2,4,6,8 keys are labeled with arrows keys, is to
1716# use the 5-key arrangement to model the arrow keys as suggested in the
1717# terminfo guidelines:
1718#   _______________________________________
1719#  |   PF1   |   PF2   |   PF3   |   PF4   |
1720#  |   $OP   |   $OQ   |   $OR   |   $OS   |
1721#  |_kf1__k1_|_kf2__k2_|_kf3__k3_|_kf4__k4_|
1722#  |    7         8         9         -    |
1723#  |   $Ow   |   $Ox   |   $Oy   |   $Om   |
1724#  |_ka1__K1_|_________|_ka3__K3_|_________|
1725#  |    4    |    5    |    6    |    ,    |
1726#  |   $Ot   |   $Ou   |   $Ov   |   $Ol   |
1727#  |_________|_kb2__K2_|_________|_________|
1728#  |    1    |    2    |    3    |         |
1729#  |   $Oq   |   $Or   |   $Os   |  enter  |
1730#  |_kc1__K4_|_________|_kc3__K5_|  $OM    |
1731#  |         0         |   .     |         |
1732#  |        $Op        |  $On    |         |
1733#  |___________________|_________|_kent_@8_|
1734vt220+keypad|dec vt220 numeric keypad,
1735	ka1=\EOw,
1736	ka3=\EOy,
1737	kb2=\EOu,
1738	kc1=\EOq,
1739	kc3=\EOs,
1740	kent=\EOM,
1741	kf1=\EOP,
1742	kf2=\EOQ,
1743	kf3=\EOR,
1744	kf4=\EOS,
1745	ka2=\EOx,
1746	kb1=\EOt,
1747	kb3=\EOv,
1748	kc2=\EOr,
1749#
1750# This should work for the commonly used "color xterm" variations (XFree86
1751# xterm, color_xterm, nxterm, rxvt).  Note that it does not set 'bce', so for
1752# XFree86 and and rxvt, some applications that use colors will be less
1753# efficient, and in a few special cases (with "smart" optimization) the wrong
1754# color will be painted in spots.
1755xterm-color|generic "ANSI" color xterm (X Window System),
1756	colors#8,
1757	ncv@,
1758	pairs#64,
1759	op=\E[m,
1760	setab=\E[4%p1%dm,
1761	setaf=\E[3%p1%dm,
1762	use=xterm-r6,
1763#
1764# vi may work better with this entry, because vi
1765# doesn't use insert mode much
1766xterm-ic|xterm-vi|xterm with insert character instead of insert mode,
1767	mir@,
1768	ich=\E[%p1%d@,
1769	ich1=\E[@,
1770	rmir@,
1771	smir@,
1772	use=xterm,
1773#
1774# This is used only for testing (it's not relevant to DEC VTxxx terminals, but
1775# to ncurses).
1776xterm-xmc|xterm with magic-cookie glitch,
1777	xmc#1,
1778	use=xterm-new,
1779#
1780# This one was originally for testing ncurses.  While the ISO 6429 defines the
1781# REP control, none of the DEC VTxxx terminals (VT52 through VT525) support it.
1782#
1783# The feature's inclusion in xterm was prompted by changes in ncurses to
1784# support testing repeat_char by Alexander Lukyanov, since no readily-available
1785# terminal supported this:
1786#
1787# + Alexander's patch was integrated in ncurses 1996/09/28
1788# + xterm patch #32 1996/11/21 was released in XFree86 3.2A 1997/01/26
1789#
1790# In July 2017, the feature was added to xterm-new in ncurses, making this
1791# entry obsolete (but it is kept for reference).
1792xterm-rep|xterm with repeat-character control,
1793	rep=%p1%c\E[%p2%{1}%-%db,
1794	use=xterm-new,
1795#
1796# This is mainly for testing xterm; the real VT220 will not let you switch
1797# character sets without first altering the keyboard language in the setup
1798# screen.  Some emulators allow this anyway.  (Note that these strings are
1799# normally used only for printers).  The parameter to csnm and scs is the same
1800# in both cases:  the keyboard language parameter returned by CSI ? 2 6 n.
1801xterm-nrc|xterm with VT220 national replacement character sets,
1802	csnm=
1803		%?
1804			%p1%{1}%=
1805			%tNorth\sAmerican
1806		%e
1807			%p1%{2}%=
1808			%tBritish
1809		%e
1810			%p1%{3}%=
1811			%tFlemish
1812		%e
1813			%p1%{4}%=
1814			%tFrench\sCanadian
1815		%e
1816			%p1%{5}%=
1817			%tDanish
1818		%e
1819			%p1%{6}%=
1820			%tFinnish
1821		%e
1822			%p1%{7}%=
1823			%tGerman
1824		%e
1825			%p1%{8}%=
1826			%tDutch
1827		%e
1828			%p1%{9}%=
1829			%tItalian
1830		%e
1831			%p1%{10}%=
1832			%tSwiss\s(French)
1833		%e
1834			%p1%{11}%=
1835			%tSwiss\s(German)
1836		%e
1837			%p1%{12}%=
1838			%tSwedish
1839		%e
1840			%p1%{13}%=
1841			%tNorwegian
1842		%e
1843			%p1%{14}%=
1844			%tFrench/Belgian
1845		%e
1846			%p1%{15}%=
1847			%tSpanish
1848		%;,
1849	scs=
1850		%?
1851			%p1%{1}%=
1852			%t\E(B
1853		%e
1854			%p1%{2}%=
1855			%t\E(A
1856		%e
1857			%p1%{3}%=
1858			%t\E(R
1859		%e
1860			%p1%{4}%=
1861			%t\E(9
1862		%e
1863			%p1%{5}%=
1864			%t\E(E
1865		%e
1866			%p1%{6}%=
1867			%t\E(5
1868		%e
1869			%p1%{7}%=
1870			%t\E(K
1871		%e
1872			%p1%{8}%=
1873			%t\E(4
1874		%e
1875			%p1%{9}%=
1876			%t\E(Y
1877		%e
1878			%p1%{10}%=
1879			%t\E(=
1880		%e
1881			%p1%{11}%=
1882			%t\E(=
1883		%e
1884			%p1%{12}%=
1885			%t\E(7
1886		%e
1887			%p1%{13}%=
1888			%t\E(E
1889		%e
1890			%p1%{14}%=
1891			%t\E(R
1892		%e
1893			%p1%{15}%=
1894			%t\E(Z
1895		%;,
1896	use=xterm-new,
1897#
1898# Foreground 0-15 maps (with toggles) into 30-37 & 90-97
1899# Background 0-15 maps (with toggles) into 40-47 & 100-107
1900#
1901# Originally I suppressed setaf/setab, since ANSI specifies only 8 colors, but
1902# Stephen Marley persuaded me to allow the "ANSI" color controls to extend to
1903# 16 colors.  (Note that ncurses 4.2 uses setf/setb from this description;
1904# however 5.0 selects either according to their availability).  - T.Dickey
1905#
1906# SVr4 curses does not use more than 8 colors anyway, so using 16 colors is
1907# either for terminfo-level applications or via ncurses.
1908xterm-16color|xterm with 16 colors,
1909	colors#16,
1910	pairs#0x100,
1911	setab=\E[
1912		%?
1913			%p1%{8}%<
1914			%t
1915			%p1%{40}%+
1916		%e
1917			%p1%{92}%+
1918		%;
1919		%dm,
1920	setaf=\E[
1921		%?
1922			%p1%{8}%<
1923			%t
1924			%p1%{30}%+
1925		%e
1926			%p1%{82}%+
1927		%;
1928		%dm,
1929	setb=
1930		%p1%{8}%/%{6}%*%{4}%+\E[%d
1931		%p1%{8}%m%Pa
1932		%?%ga%{1}%=
1933			%t4
1934		%e%ga%{3}%=
1935			%t6
1936		%e%ga%{4}%=
1937			%t1
1938		%e%ga%{6}%=
1939			%t3
1940		%e%ga%d
1941		%;
1942		m,
1943	setf=
1944		%p1%{8}%/%{6}%*%{3}%+\E[%d
1945		%p1%{8}%m%Pa
1946		%?%ga%{1}%=
1947			%t4
1948		%e%ga%{3}%=
1949			%t6
1950		%e%ga%{4}%=
1951			%t1
1952		%e%ga%{6}%=
1953			%t3
1954		%e%ga%d
1955		%;
1956		m,
1957	use=xterm+256color2,
1958	use=xterm+osc104,
1959	use=xterm-new,
1960
1961# xterm OSC 104 resets the color palette.  Using it as part of xterm+256color
1962# has the drawback that some of the xterm-alikes which use that building block
1963# require a different approach to rs1 -TD
1964xterm+osc104|reset color palette,
1965	oc=\E]104\007,
1966	rs1=\Ec\E]104\007,
1967
1968# "indexed color" is mentioned without definition in ISO 8613-6 (ITU T.416).
1969#
1970# This implementation uses a 256-element color map where the first 16 entries
1971# are shared with the aixterm-compatible colors (and in turn the first 8 are
1972# shared with the ANSI colors).  The three levels (256, 16, 8) account for the
1973# use of a conditional expression in setaf/setab which reduces the number of
1974# characters sent to the screen for typical applications.
1975#
1976# 256 colors should give 65536 pairs, but SVr4 (legacy) terminfo stores numbers
1977# in a signed short.  Most people will not notice problems with only 32767
1978# pairs.  With ncurses 6.1, numbers are stored in a signed integer (at least
1979# 32-bits), and the inconsistency regarding pairs is eliminated.
1980xterm+256color|original xterm 256-color feature,
1981	ccc,
1982	colors#0x100,
1983	pairs#0x10000,
1984	initc=\E]4;
1985		%p1%d;rgb:
1986		%p2%{255}%*%{1000}%/%2.2X/
1987		%p3%{255}%*%{1000}%/%2.2X/
1988		%p4%{255}%*%{1000}%/%2.2X\E\\,
1989	oc=\E]104\007,
1990	setab=\E[
1991		%?
1992			%p1%{8}%<
1993			%t4
1994			%p1%d
1995		%e
1996			%p1%{16}%<
1997			%t10
1998			%p1%{8}%-%d
1999		%e48;5;
2000			%p1%d
2001		%;
2002		m,
2003	setaf=\E[
2004		%?
2005			%p1%{8}%<
2006			%t3
2007			%p1%d
2008		%e
2009			%p1%{16}%<
2010			%t9
2011			%p1%{8}%-%d
2012		%e38;5;
2013			%p1%d
2014		%;
2015		m,
2016	setb@,
2017	setf@,
2018xterm+256color2|xterm 256-color feature,
2019	setab=\E[
2020		%?
2021			%p1%{8}%<
2022			%t4
2023			%p1%d
2024		%e
2025			%p1%{16}%<
2026			%t10
2027			%p1%{8}%-%d
2028		%e48:5:
2029			%p1%d
2030		%;
2031		m,
2032	setaf=\E[
2033		%?
2034			%p1%{8}%<
2035			%t3
2036			%p1%d
2037		%e
2038			%p1%{16}%<
2039			%t9
2040			%p1%{8}%-%d
2041		%e38:5:
2042			%p1%d
2043		%;
2044		m,
2045	setb@,
2046	setf@,
2047	use=xterm+256color,
2048xterm-256color|xterm with 256 colors,
2049	use=xterm+256color2,
2050	use=xterm+osc104,
2051	use=xterm-new,
2052xterm-88color|xterm with 88 colors,
2053	colors#88,
2054	pairs#7744,
2055	use=xterm-256color,
2056
2057# "direct color" is mentioned without definition in ISO 8613-6 (ITU T.416).
2058#
2059# This is a particular implementation which assume 8-bit values for red, green,
2060# and blue.  Other encodings are possible; none are addressed by that standard.
2061#
2062# The "RGB" flag is an ncurses 6.1 extension which tells the library how to
2063# quickly compute the color-content for a given color value.
2064#
2065# Like xterm+256color, this uses a conditional expression.  But it does that
2066# for a different reason: to make it readily usable for applications which
2067# print text but also use RGB colors, it uses a color map for the usual ANSI
2068# colors (0-7) and RGB colors for the remaining range of the color value.
2069xterm+direct|xterm with direct-color indexing,
2070	RGB,
2071	colors#0x1000000,
2072	pairs#0x10000,
2073	CO#8,
2074	initc@,
2075	op=\E[39;49m,
2076	setab=\E[
2077		%?
2078			%p1%{8}%<
2079			%t4
2080			%p1%d
2081		%e48:2::
2082			%p1%{65536}%/%d:
2083			%p1%{256}%/%{255}%&%d:
2084			%p1%{255}%&%d
2085		%;
2086		m,
2087	setaf=\E[
2088		%?
2089			%p1%{8}%<
2090			%t3
2091			%p1%d
2092		%e38:2::
2093			%p1%{65536}%/%d:
2094			%p1%{256}%/%{255}%&%d:
2095			%p1%{255}%&%d
2096		%;
2097		m,
2098	setb@,
2099	setf@,
2100xterm-direct|xterm with direct-color indexing,
2101	use=xterm+direct,
2102	use=xterm,
2103#
2104# This is an 8-bit version of xterm, which emulates DEC vt220 with ANSI color.
2105# To use it, your decTerminalID resource must be set to 200 or above, and the
2106# sunKeyboard resource set to true.
2107#
2108#	HTS	\E H	\210
2109#	RI	\E M	\215
2110#	SS3	\E O	\217
2111#	CSI	\E [	\233
2112#
2113xterm-8bit|xterm terminal emulator with 8-bit controls (X Window System),
2114	OTbs,
2115	am,
2116	bce,
2117	km,
2118	mc5i,
2119	mir,
2120	msgr,
2121	npc,
2122	xenl,
2123	AX,
2124	colors#8,
2125	cols#80,
2126	it#8,
2127	lines#24,
2128	pairs#64,
2129	acsc=``aaffggiijjkkllmmnnooppqqr
2130	     rssttuuvvwwxxyyzz{{||}}~~,
2131	bel=^G,
2132	blink=\2335m,
2133	bold=\2331m,
2134	cbt=\233Z,
2135	civis=\233?25l,
2136	clear=\233H\2332J,
2137	cnorm=\233?25l\233?25h,
2138	cr=\r,
2139	csr=\233%i%p1%d;%p2%dr,
2140	cub=\233%p1%dD,
2141	cub1=^H,
2142	cud=\233%p1%dB,
2143	cud1=\n,
2144	cuf=\233%p1%dC,
2145	cuf1=\233C,
2146	cup=\233%i%p1%d;%p2%dH,
2147	cuu=\233%p1%dA,
2148	cuu1=\233A,
2149	cvvis=\233?12;25h,
2150	dch=\233%p1%dP,
2151	dch1=\233P,
2152	dl=\233%p1%dM,
2153	dl1=\233M,
2154	ech=\233%p1%dX,
2155	ed=\233J,
2156	el=\233K,
2157	el1=\2331K,
2158	flash=\233?5h$<100/>\233?5l,
2159	home=\233H,
2160	hpa=\233%i%p1%dG,
2161	ht=^I,
2162	hts=\210,
2163	ich=\233%p1%d@,
2164	il=\233%p1%dL,
2165	il1=\233L,
2166	ind=\n,
2167	invis=\2338m,
2168	is2=\E[62"p\E\sG\233m\233?7h\E>
2169	    \E7\233?1;3;4;6l\2334l\233r
2170	    \E8,
2171	ka1=\217w,
2172	ka3=\217u,
2173	kb2=\217y,
2174	kbeg=\217E,
2175	kc1=\217q,
2176	kc3=\217s,
2177	kcbt=\233Z,
2178	kcub1=\217D,
2179	kcud1=\217B,
2180	kcuf1=\217C,
2181	kcuu1=\217A,
2182	kdch1=\2333~,
2183	kend=\2334~,
2184	kent=\217M,
2185	kf1=\23311~,
2186	kf10=\23321~,
2187	kf11=\23323~,
2188	kf12=\23324~,
2189	kf13=\23325~,
2190	kf14=\23326~,
2191	kf15=\23328~,
2192	kf16=\23329~,
2193	kf17=\23331~,
2194	kf18=\23332~,
2195	kf19=\23333~,
2196	kf2=\23312~,
2197	kf20=\23334~,
2198	kf3=\23313~,
2199	kf4=\23314~,
2200	kf5=\23315~,
2201	kf6=\23317~,
2202	kf7=\23318~,
2203	kf8=\23319~,
2204	kf9=\23320~,
2205	khome=\2331~,
2206	kich1=\2332~,
2207	kmous=\233M,
2208	knp=\2336~,
2209	kpp=\2335~,
2210	mc0=\233i,
2211	mc4=\2334i,
2212	mc5=\2335i,
2213	meml=\El,
2214	memu=\Em,
2215	op=\23339;49m,
2216	rc=\E8,
2217	rev=\2337m,
2218	ri=\215,
2219	rmacs=\E(B,
2220	rmam=\233?7l,
2221	rmcup=\233?1049l,
2222	rmir=\2334l,
2223	rmkx=\233?1l\E>,
2224	rmso=\23327m,
2225	rmul=\23324m,
2226	rs1=\Ec,
2227	rs2=\E[62"p\E\sG\233m\233?7h\E>
2228	    \E7\233?1;3;4;6l\2334l\233r
2229	    \E8,
2230	sc=\E7,
2231	setab=\2334%p1%dm,
2232	setaf=\2333%p1%dm,
2233	setb=\2334
2234		%?
2235			%p1%{1}%=
2236			%t4
2237		%e
2238			%p1%{3}%=
2239			%t6
2240		%e
2241			%p1%{4}%=
2242			%t1
2243		%e
2244			%p1%{6}%=
2245			%t3
2246		%e
2247			%p1%d
2248		%;
2249		m,
2250	setf=\2333
2251		%?
2252			%p1%{1}%=
2253			%t4
2254		%e
2255			%p1%{3}%=
2256			%t6
2257		%e
2258			%p1%{4}%=
2259			%t1
2260		%e
2261			%p1%{6}%=
2262			%t3
2263		%e
2264			%p1%d
2265		%;
2266		m,
2267	sgr=\2330
2268		%?
2269			%p6
2270			%t;1
2271		%;
2272		%?
2273			%p2
2274			%t;4
2275		%;
2276		%?
2277			%p1
2278			%p3%|
2279			%t;7
2280		%;
2281		%?
2282			%p4
2283			%t;5
2284		%;
2285		%?
2286			%p7
2287			%t;8
2288		%;
2289		m
2290		%?
2291			%p9
2292			%t\E(0
2293		%e
2294			\E(B
2295		%;,
2296	sgr0=\2330m\E(B,
2297	smacs=\E(0,
2298	smam=\233?7h,
2299	smcup=\233?1049h,
2300	smir=\2334h,
2301	smkx=\233?1h\E=,
2302	smso=\2337m,
2303	smul=\2334m,
2304	tbc=\2333g,
2305	u6=\233[%i%d;%dR,
2306	u7=\E[6n,
2307	u8=\233[?%[;0123456789]c,
2308	u9=\E[c,
2309	vpa=\233%i%p1%dd,
2310	use=xterm+kbs,
2311#
2312xterm-xf86-v44|xterm terminal emulator (XFree86 4.4 Window System),
2313	OTbs,
2314	am,
2315	bce,
2316	km,
2317	mc5i,
2318	mir,
2319	msgr,
2320	npc,
2321	xenl,
2322	AX,
2323	XT,
2324	colors#8,
2325	cols#80,
2326	it#8,
2327	lines#24,
2328	pairs#64,
2329	acsc=``aaffggiijjkkllmmnnooppqqr
2330	     rssttuuvvwwxxyyzz{{||}}~~,
2331	bel=^G,
2332	blink=\E[5m,
2333	bold=\E[1m,
2334	cbt=\E[Z,
2335	civis=\E[?25l,
2336	clear=\E[H\E[2J,
2337	cnorm=\E[?12l\E[?25h,
2338	cr=\r,
2339	csr=\E[%i%p1%d;%p2%dr,
2340	cub=\E[%p1%dD,
2341	cub1=^H,
2342	cud=\E[%p1%dB,
2343	cud1=\n,
2344	cuf=\E[%p1%dC,
2345	cuf1=\E[C,
2346	cup=\E[%i%p1%d;%p2%dH,
2347	cuu=\E[%p1%dA,
2348	cuu1=\E[A,
2349	cvvis=\E[?12;25h,
2350	dch=\E[%p1%dP,
2351	dch1=\E[P,
2352	dl=\E[%p1%dM,
2353	dl1=\E[M,
2354	ech=\E[%p1%dX,
2355	ed=\E[J,
2356	el=\E[K,
2357	el1=\E[1K,
2358	enacs=\E(B\E)0,
2359	flash=\E[?5h$<100/>\E[?5l,
2360	home=\E[H,
2361	hpa=\E[%i%p1%dG,
2362	ht=^I,
2363	hts=\EH,
2364	ich=\E[%p1%d@,
2365	il=\E[%p1%dL,
2366	il1=\E[L,
2367	ind=\n,
2368	indn=\E[%p1%dS,
2369	invis=\E[8m,
2370	is2=\E[!p\E[?3;4l\E[4l\E>,
2371	kDC=\E[3;2~,
2372	kEND=\E[1;2F,
2373	kHOM=\E[1;2H,
2374	kIC=\E[2;2~,
2375	kLFT=\E[1;2D,
2376	kNXT=\E[6;2~,
2377	kPRV=\E[5;2~,
2378	kRIT=\E[1;2C,
2379	kb2=\EOE,
2380	kcbt=\E[Z,
2381	kcub1=\EOD,
2382	kcud1=\EOB,
2383	kcuf1=\EOC,
2384	kcuu1=\EOA,
2385	kdch1=\E[3~,
2386	kend=\EOF,
2387	kent=\EOM,
2388	kf1=\EOP,
2389	kf10=\E[21~,
2390	kf11=\E[23~,
2391	kf12=\E[24~,
2392	kf13=\EO2P,
2393	kf14=\EO2Q,
2394	kf15=\EO2R,
2395	kf16=\EO2S,
2396	kf17=\E[15;2~,
2397	kf18=\E[17;2~,
2398	kf19=\E[18;2~,
2399	kf2=\EOQ,
2400	kf20=\E[19;2~,
2401	kf21=\E[20;2~,
2402	kf22=\E[21;2~,
2403	kf23=\E[23;2~,
2404	kf24=\E[24;2~,
2405	kf25=\EO5P,
2406	kf26=\EO5Q,
2407	kf27=\EO5R,
2408	kf28=\EO5S,
2409	kf29=\E[15;5~,
2410	kf3=\EOR,
2411	kf30=\E[17;5~,
2412	kf31=\E[18;5~,
2413	kf32=\E[19;5~,
2414	kf33=\E[20;5~,
2415	kf34=\E[21;5~,
2416	kf35=\E[23;5~,
2417	kf36=\E[24;5~,
2418	kf37=\EO6P,
2419	kf38=\EO6Q,
2420	kf39=\EO6R,
2421	kf4=\EOS,
2422	kf40=\EO6S,
2423	kf41=\E[15;6~,
2424	kf42=\E[17;6~,
2425	kf43=\E[18;6~,
2426	kf44=\E[19;6~,
2427	kf45=\E[20;6~,
2428	kf46=\E[21;6~,
2429	kf47=\E[23;6~,
2430	kf48=\E[24;6~,
2431	kf5=\E[15~,
2432	kf6=\E[17~,
2433	kf7=\E[18~,
2434	kf8=\E[19~,
2435	kf9=\E[20~,
2436	khome=\EOH,
2437	kich1=\E[2~,
2438	kmous=\E[M,
2439	knp=\E[6~,
2440	kpp=\E[5~,
2441	mc0=\E[i,
2442	mc4=\E[4i,
2443	mc5=\E[5i,
2444	meml=\El,
2445	memu=\Em,
2446	op=\E[39;49m,
2447	rc=\E8,
2448	rev=\E[7m,
2449	ri=\EM,
2450	rin=\E[%p1%dT,
2451	rmacs=^O,
2452	rmam=\E[?7l,
2453	rmir=\E[4l,
2454	rmkx=\E[?1l\E>,
2455	rmso=\E[27m,
2456	rmul=\E[24m,
2457	rs1=\Ec,
2458	rs2=\E[!p\E[?3;4l\E[4l\E>,
2459	sc=\E7,
2460	setab=\E[4%p1%dm,
2461	setaf=\E[3%p1%dm,
2462	setb=\E[4
2463		%?
2464			%p1%{1}%=
2465			%t4
2466		%e
2467			%p1%{3}%=
2468			%t6
2469		%e
2470			%p1%{4}%=
2471			%t1
2472		%e
2473			%p1%{6}%=
2474			%t3
2475		%e
2476			%p1%d
2477		%;
2478		m,
2479	setf=\E[3
2480		%?
2481			%p1%{1}%=
2482			%t4
2483		%e
2484			%p1%{3}%=
2485			%t6
2486		%e
2487			%p1%{4}%=
2488			%t1
2489		%e
2490			%p1%{6}%=
2491			%t3
2492		%e
2493			%p1%d
2494		%;
2495		m,
2496	sgr=\E[0
2497		%?
2498			%p6
2499			%t;1
2500		%;
2501		%?
2502			%p2
2503			%t;4
2504		%;
2505		%?
2506			%p1
2507			%p3%|
2508			%t;7
2509		%;
2510		%?
2511			%p4
2512			%t;5
2513		%;
2514		%?
2515			%p7
2516			%t;8
2517		%;
2518		m
2519		%?
2520			%p9
2521			%t\016
2522		%e
2523			\017
2524		%;,
2525	sgr0=\E[m\017,
2526	smacs=^N,
2527	smam=\E[?7h,
2528	smir=\E[4h,
2529	smkx=\E[?1h\E=,
2530	smso=\E[7m,
2531	smul=\E[4m,
2532	tbc=\E[3g,
2533	u6=\E[%i%d;%dR,
2534	u7=\E[6n,
2535	u8=\E[?1;2c,
2536	u9=\E[c,
2537	vpa=\E[%i%p1%dd,
2538	ka2=\EOx,
2539	kb1=\EOt,
2540	kb3=\EOv,
2541	kc2=\EOr,
2542	use=xterm+alt1049,
2543	use=xterm+kbs,
2544xterm-xfree86|xterm terminal emulator (XFree86 4.4 Window System),
2545	use=xterm-xf86-v44,
2546#
2547# Compatible with the R6 xterm, with the following changes:
2548#	+ added acsc (perhaps some versions of tic assume the standard vt100
2549#	  alternate character set)
2550#	+ added u6, u7, u8, u9 strings for Daniel Weaver's tack program.
2551#	+ added kmous string for ncurses.
2552#	+ added khome/kend strings (which conflict with kfnd/kslt, see note).
2553xterm-r6|xterm X11R6 version,
2554	OTbs,
2555	am,
2556	km,
2557	mir,
2558	msgr,
2559	xenl,
2560	cols#80,
2561	it#8,
2562	lines#24,
2563	acsc=``aaffggiijjkkllmmnnooppqqr
2564	     rssttuuvvwwxxyyzz{{||}}~~,
2565	bel=^G,
2566	bold=\E[1m,
2567	clear=\E[H\E[2J,
2568	cr=\r,
2569	csr=\E[%i%p1%d;%p2%dr,
2570	cub=\E[%p1%dD,
2571	cub1=^H,
2572	cud=\E[%p1%dB,
2573	cud1=\n,
2574	cuf=\E[%p1%dC,
2575	cuf1=\E[C,
2576	cup=\E[%i%p1%d;%p2%dH,
2577	cuu=\E[%p1%dA,
2578	cuu1=\E[A,
2579	dch=\E[%p1%dP,
2580	dch1=\E[P,
2581	dl=\E[%p1%dM,
2582	dl1=\E[M,
2583	ed=\E[J,
2584	el=\E[K,
2585	enacs=\E)0,
2586	home=\E[H,
2587	ht=^I,
2588	hts=\EH,
2589	il=\E[%p1%dL,
2590	il1=\E[L,
2591	ind=\n,
2592	is2=\E[m\E[?7h\E[4l\E>\E7\E[r\E[
2593	    ?1;3;4;6l\E8,
2594	kcub1=\EOD,
2595	kcud1=\EOB,
2596	kcuf1=\EOC,
2597	kcuu1=\EOA,
2598	kdch1=\E[3~,
2599	kf1=\E[11~,
2600	kf10=\E[21~,
2601	kf11=\E[23~,
2602	kf12=\E[24~,
2603	kf13=\E[25~,
2604	kf14=\E[26~,
2605	kf15=\E[28~,
2606	kf16=\E[29~,
2607	kf17=\E[31~,
2608	kf18=\E[32~,
2609	kf19=\E[33~,
2610	kf2=\E[12~,
2611	kf20=\E[34~,
2612	kf3=\E[13~,
2613	kf4=\E[14~,
2614	kf5=\E[15~,
2615	kf6=\E[17~,
2616	kf7=\E[18~,
2617	kf8=\E[19~,
2618	kf9=\E[20~,
2619	kmous=\E[M,
2620	meml=\El,
2621	memu=\Em,
2622	rc=\E8,
2623	rev=\E[7m,
2624	ri=\EM,
2625	rmacs=^O,
2626	rmcup=\E[2J\E[?47l\E8,
2627	rmir=\E[4l,
2628	rmkx=\E[?1l\E>,
2629	rmso=\E[m,
2630	rmul=\E[m,
2631	rs2=\E[m\E[?7h\E[4l\E>\E7\E[r\E[
2632	    ?1;3;4;6l\E8,
2633	sc=\E7,
2634	sgr0=\E[m,
2635	smacs=^N,
2636	smcup=\E7\E[?47h,
2637	smir=\E[4h,
2638	smkx=\E[?1h\E=,
2639	smso=\E[7m,
2640	smul=\E[4m,
2641	tbc=\E[3g,
2642	u6=\E[%i%d;%dR,
2643	u7=\E[6n,
2644	u8=\E[?1;2c,
2645	u9=\E[c,
2646	use=xterm+kbs,
2647	use=xterm+decedit,
2648xterm-old|antique xterm version,
2649	use=xterm-r6,
2650#
2651# Compatible with the R5 xterm, with the following changes:
2652#	+ changed 'blink=@', to 'blink@' (the former meant that "@" would start
2653#	  a blink, the latter that it is not supported).
2654#	+ changed kf1 through kf4 to correspond with actual usage.  Though X
2655#	  supports keypad symbols for PF1 to PF4, and xterm interprets these
2656#	  correctly, the F1 to F4 codes are commonly (but incorrectly) used.
2657#	+ moved reset string from rs1 to rs2, to correlate better with termcap.
2658#	+ make khome consistent with other entries.
2659#	+ use rmul/smul, rmir/smir from termcap, but not rmcup/smcup because
2660#	  not everyone wants the alternate screen.
2661#	+ added u6, u7, u8, u9 strings for Daniel Weaver's tack program.
2662#	+ added kmous string for ncurses.
2663xterm-r5|xterm R5 version,
2664	OTbs,
2665	am,
2666	km,
2667	msgr,
2668	xenl,
2669	cols#80,
2670	it#8,
2671	lines#24,
2672	bel=^G,
2673	bold=\E[1m,
2674	clear=\E[H\E[2J,
2675	cr=\r,
2676	csr=\E[%i%p1%d;%p2%dr,
2677	cub=\E[%p1%dD,
2678	cub1=^H,
2679	cud=\E[%p1%dB,
2680	cud1=\n,
2681	cuf=\E[%p1%dC,
2682	cuf1=\E[C,
2683	cup=\E[%i%p1%d;%p2%dH,
2684	cuu=\E[%p1%dA,
2685	cuu1=\E[A,
2686	dch=\E[%p1%dP,
2687	dch1=\E[P,
2688	dl=\E[%p1%dM,
2689	dl1=\E[M,
2690	ed=\E[J,
2691	el=\E[K,
2692	home=\E[H,
2693	ht=^I,
2694	hts=\EH,
2695	ich=\E[%p1%d@,
2696	ich1=\E[@,
2697	il=\E[%p1%dL,
2698	il1=\E[L,
2699	ind=\n,
2700	kcub1=\EOD,
2701	kcud1=\EOB,
2702	kcuf1=\EOC,
2703	kcuu1=\EOA,
2704	kdch1=\E[3~,
2705	kdl1=\E[31~,
2706	kel=\E[8~,
2707	kend=\E[4~,
2708	kf0=\EOq,
2709	kf1=\E[11~,
2710	kf10=\E[21~,
2711	kf11=\E[23~,
2712	kf12=\E[24~,
2713	kf2=\E[12~,
2714	kf3=\E[13~,
2715	kf4=\E[14~,
2716	kf5=\E[15~,
2717	kf6=\E[17~,
2718	kf7=\E[18~,
2719	kf8=\E[19~,
2720	kf9=\E[20~,
2721	khome=\E[1~,
2722	kich1=\E[2~,
2723	kil1=\E[30~,
2724	kmous=\E[M,
2725	knp=\E[6~,
2726	kpp=\E[5~,
2727	rc=\E8,
2728	rev=\E[7m,
2729	ri=\EM,
2730	rmir=\E[4l,
2731	rmkx=\E[?1l\E>,
2732	rmso=\E[m,
2733	rmul=\E[m,
2734	rs2=\E>\E[?1;3;4;5;6l\E[4l\E[?7h
2735	    \E[m\E[r\E[2J\E[H,
2736	sc=\E7,
2737	sgr=\E[
2738		%?
2739			%p1
2740			%t;7
2741		%;
2742		%?
2743			%p2
2744			%t;4
2745		%;
2746		%?
2747			%p3
2748			%t;7
2749		%;
2750		%?
2751			%p4
2752			%t;5
2753		%;
2754		%?
2755			%p6
2756			%t;1
2757		%;
2758		m,
2759	sgr0=\E[m,
2760	smir=\E[4h,
2761	smkx=\E[?1h\E=,
2762	smso=\E[7m,
2763	smul=\E[4m,
2764	tbc=\E[3g,
2765	u6=\E[%i%d;%dR,
2766	u7=\E[6n,
2767	u8=\E[?1;2c,
2768	u9=\E[c,
2769	use=xterm+kbs,
2770
2771# DEC status-line is an extension for VT220, and standard with VT320 and up.
2772dec+sl|DEC VTxx status line,
2773	eslok,
2774	hs,
2775	dsl=\E[1$~,
2776	fsl=\E[0$},
2777	tsl=\E[2$~\E[1$}\E[%i%p1%d`,
2778#
2779#
2780# Customization begins here.
2781#
2782# This is the only entry which you should have to customize, since "xterm"
2783# is widely used for a variety of incompatible terminal emulations including
2784# color_xterm and rxvt.
2785xterm|X11 terminal emulator,
2786	use=xterm-new,
2787#	use=xterm-r6,
2788
2789# This fragment is for people who cannot agree on what the backspace key
2790# should send.
2791xterm+kbs|fragment for backspace key,
2792	kbs=^H,
2793#	kbs=^?,
2794