Fix all of the incorrect key mappings documented in the following table:

https://jakub.horky.net/terminal/keyname.html

The only exception is F13-F19 keys for xterm, WezTerm, and mlterm, as
there is currently no standard way to accommodate both shifted and
physical keys above F12 in terminfo.

Changes:
  + abandon incorrect vt100+keypad mappings for ka1-kc3 ("cross") keypad
    keys
  + since VT100 and VT220 have exactly the same numeric keypad and its
    sequences, unify vt100+keypad and vt220+keypad, and rename
    references
    from vt220+keypad to vt100+keypad
  + add kpCMA, kpDOT, kpSUB, and kpZRO to vt100+keypad; also add
    vt100+keypad+emul to emulate PF1-PF4 on top row of the keypad
  + correct xterm+keypad keys when in non-sunKeyboard mode
  + add kbeg, kp5 keys to xterm+noapp
  + add kmnu including shifted variants to xterm+nofkeys
  + add support for shifted keypad keys as xterm+pck0
  + modify xterm+keypad and add xterm+keypad+noent to serve as a common
    key set for other terminals; add xterm+keypad+all and
    xterm+keypad+novt for full-featured xterm and fix xterm-vt220
  + remove ncv from putty, since color support doesn't affect the
    features
  + add kbeg, kENT and kPADD (shift+kpADD) keys to putty
  + add putty-xterm as the richest variant in terms of modified keys
  + add -direct and -direct16 for putty, putty-xterm, and wezterm
  + fix teraterm-4.97, which no longer emulates VT220 editing keys
    based on their physical locations
  + add support for xterm shifted keys to winconsole, fix kbs and kspd
  + set numpad 5 to kbeg instead of kb5 in linux-basic, matching xterm
  + set kspd (suspend key) to the Pause key instead of ^Z in linux-basic
  + add full VT100 keypad support to nsterm, as it is supported
  + remove unsupported keypad app mode from xnuppc-basic
  + add xterm-style keypad app mode to iTerm.app, mlterm3, and st
  + add kbeg key to konsole-base and terminology
  + add kmnu key to mlterm2+
  + remove ka1-kc3 and kent keys, and add kbeg key to st
  + remove VT100 keypad support (except PF1-PF4) from xtalk and mvterm,
    since they don't support application keypad mode
  + add full VT100 keypad support to wy85-8bit and tek4105-30, as they
    support application keypad mode
  + update documentation of caps described in user_caps(5) man page
  + update documentation of key extended caps

I tested the changes live in all terminals listed in the table.

These changes are relative to the previous version of the patch
(2025-10-13):
  + added kbeg key to terminology
  + instead of removing keypad app mode in nsterm-7, added full VT100
    keypad support, as it is actually supported

Signed-off-by: Jakub Horký <[email protected]>
---
 misc/terminfo.src | 411 ++++++++++++++++++++++++++++++----------------
 1 file changed, 266 insertions(+), 145 deletions(-)

diff --git a/misc/terminfo.src b/misc/terminfo.src
index 1f31a52a..ff3bd982 100644
--- a/misc/terminfo.src
+++ b/misc/terminfo.src
@@ -977,8 +977,8 @@ linux-basic|Linux console (basic),
 	     \264v\301w\302x\263y\363z\362{\343|\330}\234~\376,
 	bel=^G, cr=\r, cub1=^H, cud1=\n, dim=\E[2m, ech=\E[%p1%dX,
 	el1=\E[1K, flash=\E[?5h$<200/>\E[?5l, ht=^I, hts=\EH,
-	ind=\n, kb2=\E[G, kbs=^?, kcbt=\E[Z, khome=\E[1~, kmous=\E[M,
-	kspd=^Z, nel=\r\n, ri=\EM, rmam=\E[?7l, rs1=\Ec\E]R,
+	ind=\n, kbeg=\E[G, kbs=^?, kcbt=\E[Z, khome=\E[1~, kmous=\E[M,
+	kspd=\E[P, nel=\r\n, ri=\EM, rmam=\E[?7l, rs1=\Ec\E]R,
 	sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p5
 	    %t;2%;%?%p6%t;1%;%?%p9%t;11%;m,
 	smam=\E[?7h, tbc=\E[3g, use=ecma+underline,
@@ -2414,61 +2414,39 @@ vt52+arrows|cursor keys for VT52,
 # generates in Application Keypad mode (where "$" means the ESC
 # character).  The third line contains two items, first the mapping of
 # the key in terminfo, and then in termcap.
+#
 #   _______________________________________
 #  |   PF1   |   PF2   |   PF3   |   PF4   |
 #  |   $OP   |   $OQ   |   $OR   |   $OS   |
 #  |_kf1__k1_|_kf2__k2_|_kf3__k3_|_kf4__k4_|
 #  |    7         8         9         -    |
 #  |   $Ow   |   $Ox   |   $Oy   |   $Om   |
-#  |_kf9__k9_|_kf10_k;_|_kf0__k0_|_________|
+#  |_ka1__K1_|___ka2___|_ka3__K3_|__kpSUB__|
 #  |    4    |    5    |    6    |    ,    |
 #  |   $Ot   |   $Ou   |   $Ov   |   $Ol   |
-#  |_kf5__k5_|_kf6__k6_|_kf7__k7_|_kf8__k8_|
+#  |___kb1___|_kb2__K2_|___kb3___|__kpCMA__|
 #  |    1    |    2    |    3    |         |
 #  |   $Oq   |   $Or   |   $Os   |  enter  |
-#  |_ka1__K1_|_kb2__K2_|_ka3__K3_|  $OM    |
+#  |_kc1__K4_|___kc2___|_kc3__K5_|  $OM    |
 #  |         0         |   .     |         |
 #  |        $Op        |  $On    |         |
-#  |___kc1_______K4____|_kc3__K5_|_kent_@8_|
+#  |_______kpZRO_______|__kpDOT__|_kent_@8_|
+#
+# Note that ka2, kb1, kb3 and kc2 are extended caps which have no termcap
+# equivalent.
 #
-# Note however, that the arrangement of the 5-key ka1-kc3 do not follow the
-# terminfo guidelines.  That is a compromise used to assign the remaining
-# keys on the keypad to kf5-kf0, used on older systems with legacy termcap
-# support:
-vt100+keypad|DEC VT100 numeric keypad no fkeys,
-	ka1=\EOq, ka3=\EOs, kb2=\EOr, kc1=\EOp, kc3=\EOn,
-vt100+pf1-pf4|DEC VT100 PF1-PF4,
+vt100+pf1-pf4|DEC VT100/VT220 PF1-PF4,
 	kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS,
-vt100+pfkeys|DEC VT100 numeric keypad (kf1-kf4),
-	kent=\EOM, use=vt100+pf1-pf4, use=vt100+keypad,
-vt100+fnkeys|DEC VT100 numeric keypad (kf0-kf10),
-	kf0=\EOy, kf10=\EOx, kf5=\EOt, kf6=\EOu, kf7=\EOv, kf8=\EOl,
-	kf9=\EOw, use=vt100+pfkeys,
-#
-# A better adaptation to modern keyboards such as the PC's, which have a dozen
-# function keys and the keypad 2,4,6,8 keys are labeled with arrows keys, is to
-# use the 5-key arrangement to model the arrow keys as suggested in the
-# terminfo guidelines:
-#   _______________________________________
-#  |   PF1   |   PF2   |   PF3   |   PF4   |
-#  |   $OP   |   $OQ   |   $OR   |   $OS   |
-#  |_kf1__k1_|_kf2__k2_|_kf3__k3_|_kf4__k4_|
-#  |    7         8         9         -    |
-#  |   $Ow   |   $Ox   |   $Oy   |   $Om   |
-#  |_ka1__K1_|_________|_ka3__K3_|_________|
-#  |    4    |    5    |    6    |    ,    |
-#  |   $Ot   |   $Ou   |   $Ov   |   $Ol   |
-#  |_________|_kb2__K2_|_________|_________|
-#  |    1    |    2    |    3    |         |
-#  |   $Oq   |   $Or   |   $Os   |  enter  |
-#  |_kc1__K4_|_________|_kc3__K5_|  $OM    |
-#  |         0         |   .     |         |
-#  |        $Op        |  $On    |         |
-#  |___________________|_________|_kent_@8_|
 #
-vt220+keypad|DEC VT220 numeric keypad,
-	ka1=\EOw, ka3=\EOy, kb2=\EOu, kc1=\EOq, kc3=\EOs, ka2=\EOx,
-	kb1=\EOt, kb3=\EOv, kc2=\EOr, use=vt100+pfkeys,
+vt100+keypad|vt220+keypad|DEC VT100/VT220 numeric keypad,
+	ka2=\EOx, kb1=\EOt, kb3=\EOv, kc2=\EOr,
+	kpCMA=\EOl, kpDOT=\EOn, kpSUB=\EOm, kpZRO=\EOp,
+	kent=\EOM, ka1=\EOw, ka3=\EOy, kb2=\EOu, kc1=\EOq, kc3=\EOs,
+	use=vt100+pf1-pf4,
+#
+vt100+keypad+emul|DEC VT100/VT220 numeric keypad with PF1-PF4 emulation,
+	kpNUM=\EOP, kpDIV=\EOQ, kpMUL=\EOR, kpSUB=\EOS,
+	use=vt100+keypad,
 #
 vt100+enq|ncurses extension for VT100-style ENQ,
 	u8=\E[?1;2c, use=ansi+enq,
@@ -2519,7 +2497,7 @@ vt100|vt100-am|DEC VT100 (w/advanced video),
 	    %;m%?%p9%t\016%e\017%;$<2>,
 	smam=\E[?7h, smkx=\E[?1h\E=, smso=\E[7m$<2>,
 	use=ansi+csr, use=ansi+pp, use=decid+cpr, use=vt100+4bsd,
-	use=vt100+fnkeys,
+	use=vt100+keypad,
 
 vt100+4bsd|DEC VT100 from 4.0BSD,
 	am, msgr,
@@ -2858,7 +2836,7 @@ vt320|vt300|DEC VT320 7 bit terminal,
 	use=ansi+csr, use=ansi+cup, use=ansi+enq, use=ansi+erase,
 	use=ansi+idl, use=ansi+local, use=ansi+sgrso,
 	use=ansi+sgrul, use=dec+pp, use=dec+sl, use=vt220+cvis,
-	use=vt220+keypad, use=vt220+sfkeys, use=vt220+ufkeys,
+	use=vt100+keypad, use=vt220+sfkeys, use=vt220+ufkeys,
 
 vt320-nam|vt300-nam|DEC VT320 7 bit terminal with no am to make SAS happy,
 	am@,
@@ -3090,10 +3068,10 @@ vt525-w|DEC VT525 in wide mode,
 #
 # In trying to get the function keys to work, I had to cobble my own
 # terminfo.src entry, since the existing vt520 entry doesn't include most of
-# the function keys.  If I blend the entries for "vt420f" and "vt220+keypad"
+# the function keys.  If I blend the entries for "vt420f" and "vt100+keypad"
 # I seem to get them all -Mike Gran
 vt520ansi|Boundless VT520 ANSI,
-	use=ansi+rca, use=vt420f, use=vt220+keypad,
+	use=ansi+rca, use=vt420f, use=vt100+keypad,
 	use=ansi+tabs,
 
 #### VT100 emulations
@@ -3357,7 +3335,7 @@ nsterm+7|AppKit Terminal.app v41+ basic capabilities w/ASCII charset,
 	sgr0=\E[m, smam=\E[?7h, smkx=\E[?1h\E=, tbc=\E[3g,
 	use=ansi+csr, use=ansi+cup, use=ansi+erase, use=ansi+idl,
 	use=ansi+local, use=ansi+sgrbold, use=vt100+enq,
-	use=vt100+pfkeys,
+	use=vt100+keypad,
 
 nsterm+acs|AppKit Terminal.app v41+ basic capabilities w/VT100 alternate-charset,
 	sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?
@@ -3651,7 +3629,7 @@ iTerm.app|iterm|iTerm.app terminal emulator for Mac OS X,
 	use=ansi+csr, use=ansi+enq, use=ansi+erase, use=ansi+idc,
 	use=ansi+idl, use=ansi+local, use=ansi+rca2,
 	use=ansi+sgrso, use=ansi+sgrul, use=vt100+4bsd,
-	use=vt100+keypad, use=vt100+pfkeys, use=xterm+r5+fkeys,
+	kpEQU=\EOX, use=xterm+keypad, use=xterm+r5+fkeys,
 	use=xterm+alt47, use=xterm+sl-twm, use=xterm+x11mouse,
 	use=xterm+256setaf, use=vt220+cvis,
 
@@ -3865,13 +3843,12 @@ xnuppc+basic|Darwin PowerPC console basic capabilities,
 	it#8,
 	bold=\E[1m, cr=\r, dsl=\E]2;\007, el1=\E[1K, ht=^I, hts=\EH,
 	ind=\n, kbs=^?, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC,
-	kcuu1=\EOA, rev=\E[7m, ri=\EM, rmam=\E[?7l, rmkx=\E[?1l\E>,
-	rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h,
+	kcuu1=\EOA, rev=\E[7m, ri=\EM, rmam=\E[?7l,
+	rs2=\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h,
 	sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;m,
-	sgr0=\E[m, smam=\E[?7h, smkx=\E[?1h\E=, tbc=\E[3g,
+	sgr0=\E[m, smam=\E[?7h, tbc=\E[3g,
 	use=ansi+csr, use=ansi+cup, use=ansi+erase,
 	use=ansi+local, use=ansi+sgrso, use=ansi+sgrul,
-	use=vt100+keypad,
 
 xnuppc+c|Darwin PowerPC console ANSI color support,
 	ncv#32, use=klone+color,
@@ -4206,7 +4183,7 @@ absolute|Absolute Telnet emulating xterm,
 #	http://stackoverflow.com/questions/24613237/terminal-retains-bg-color-after-closing-vim-using-color-scheme-and-putty-256co/37869114#37869114
 putty|PuTTY terminal emulator,
 	am, bce, bw, ccc, mir, msgr, xenl, xon, XT,
-	it#8, ncv#22, U8#1,
+	it#8, ncv@, U8#1,
 	acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
 	bel=^G, cr=\r, cub1=^H, cud1=\ED, cuu1=\EM, dch=\E[%p1%dP,
 	dch1=\E[P,
@@ -4220,7 +4197,7 @@ putty|PuTTY terminal emulator,
 	flash=\E[?5h$<100/>\E[?5l, ind=\n,
 	initc=\E]P%p1%x%p2%{255}%*%{1000}%/%02x%p3%{255}%*%{1000}%/
 	      %02x%p4%{255}%*%{1000}%/%02x,
-	is2=\E7\E[r\E[m\E[?7h\E[?1;4;6l\E[4l\E8\E>\E]R,
+	is2=\E7\E[r\E[m\E[?7h\E[?1;4;6l\E[4l\E8\E>\E]R, kbeg=\E[G,
 	kbs=^?, kcbt=\E[Z, khome=\E[1~, kind=\E[B, kri=\E[A, kspd=^Z,
 	nel=\r\n, oc=\E]R, op=\E[39;49m, ri=\EM, rmacs=^O,
 	rmam=\E[?7l, rmir=\E[4l, rmkx=\E[?1l\E>,
@@ -4229,7 +4206,7 @@ putty|PuTTY terminal emulator,
 	sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5
 	    %;m%?%p9%t\016%e\017%;,
 	sgr0=\E[m\017, smacs=^N, smam=\E[?7h, smir=\E[4h,
-	smkx=\E[?1h\E=, E3=\E[3J, rv=\E\\[>0;136;0c,
+	smkx=\E[?1h\E=, E3=\E[3J, kENT=\E^M, rv=\E\\[>0;136;0c,
 	use=ecma+underline, use=ecma+standout,
 	use=ansi+apparrows, use=ansi+csr, use=ansi+cup,
 	use=ansi+erase, use=ansi+idl, use=ansi+local,
@@ -4238,8 +4215,12 @@ putty|PuTTY terminal emulator,
 	use=klone+color, use=klone+sgr, use=putty+cursor,
 	use=putty+fnkeys, use=report+da2, use=vt220+pcedit,
 	use=xterm+alt1049, use=vt102+enq, use=xterm+sm+1006,
-	use=xterm+sl, use=vt100+fnkeys, use=putty+keypad,
+	use=xterm+sl, use=putty+keypad, use=putty+keypad+kp,
 	use=vt220+cvis,
+putty-direct|PuTTY terminal emulator with direct colors,
+	use=xterm+indirect, use=putty,
+putty-direct16|PuTTY terminal emulator with direct colors (16 indexed),
+	use=xterm+indirect16, use=putty,
 
 # older versions (e.g., before 0.71) of PuTTY used a shift-modifier to toggle
 # between normal- and application-mode for the cursor-keys.  That was dropped,
@@ -4247,9 +4228,10 @@ putty|PuTTY terminal emulator,
 putty+cursor|PuTTY modified cursor-keys,
 	kDN5=\E[B, kLFT5=\E[D, kRIT5=\E[C, kUP5=\E[A,
 putty+keypad|PuTTY numeric keypad,
+	kpADD=\EOl, kPADD=\EOm, use=vt100+keypad+emul,
+putty+keypad+kp|PuTTY numeric keypad (kp1-9),
 	kp1=\EOq, kp2=\EOr, kp3=\EOs, kp4=\EOt, kp5=\EOu, kp6=\EOv,
-	kp7=\EOw, kp8=\EOx, kp9=\EOy, kpADD=\EOl, kpDIV=\EOQ,
-	kpDOT=\EOn, kpMUL=\EOR, kpNUM=\EOP, kpSUB=\EOS, kpZRO=\EOp,
+	kp7=\EOw, kp8=\EOx, kp9=\EOy,
 
 vt100-putty|Reset PuTTY to pure VT100,
 	rs2=\E<\E["p\Ec\E[?3l\E]R\E[40"p\E[61"p\E[50;1;2"p,
@@ -4269,6 +4251,20 @@ putty-vt100|VT100+ keyboard layout,
 putty-sco|putty with SCO function keys,
 	use=putty+fnkeys+sco, use=putty,
 
+# This is the richest variant in terms of keyboard combinations. Need to set
+# both the "Xterm 216+" and "xterm-style bitmap" options. Shifted keys don't
+# work in cursor app mode, so don't activate it.
+putty-xterm|putty with Xterm 216+ and xterm-style bitmap function keys,
+	kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kend=\E[4~, khome=\E[1~,
+	rmkx=\E>, smkx=\E=,
+	use=xterm+noapp, use=putty+fnkeys+xterm-new, use=putty,
+putty-xterm-256color|PuTTY terminal emulator with xterm 256-colors,
+	use=xterm+256setaf, use=putty-xterm,
+putty-xterm-direct|PuTTY terminal emulator with direct colors,
+	use=xterm+indirect, use=putty-xterm,
+putty-xterm-direct16|PuTTY terminal emulator with direct colors (16 indexed),
+	use=xterm+indirect16, use=putty-xterm,
+
 # PuTTY has more than one section in its Keyboard configuration:
 # a) backspace/delete, which we ignore since that choice largely depends on
 #    whether one matches Unix and BSD or Linux.
@@ -4323,6 +4319,12 @@ putty+fnkeys+sco|SCO fn-keys for PuTTY,
 	kf5=\E[Q, kf6=\E[R, kf7=\E[S, kf8=\E[T, kf9=\E[U, kich1=\E[L,
 	knp=\E[G, kpp=\E[I, use=vt100+noapp,
 
+putty+fnkeys+xterm-new|Xterm 216+ fn-keys for PuTTY with xterm+style bitmap,
+	kend=\E[4~, khome=\E[1~, kEND=\E[4;2~, kEND3=\E[4;3~, kEND4=\E[4;4~,
+	kEND5=\E[4;5~, kEND6=\E[4;6~, kEND7=\E[4;7~, kHOM=\E[1;2~,
+	kHOM3=\E[1;3~, kHOM4=\E[4;1~, kHOM5=\E[1;5~, kHOM6=\E[1;6~,
+	kHOM7=\E[1;7~, use=xterm+pcfkeys,
+
 #### mintty
 # https://github.com/mintty/mintty
 #
@@ -4492,10 +4494,12 @@ teraterm4.59|Tera Term 4.59,
 #	+ recognizes xterm's original direct-colors sequences, but result is
 #	  poor.
 #	+ no UTF-8 apparent when UTF-8 is set, with font Lucida Control
+#
+# This version no longer emulates VT220 editing keys layout by default. --JH
 teraterm4.97|Tera Term 4.97,
-	XT, use=ecma+color, use=xterm+sm+1006, use=teraterm4.59,
-teraterm-256color|TeraTerm with xterm 256-colors,
-	use=xterm+256setaf, use=teraterm,
+	XT,
+	kslt@, kdch1=^?, use=ecma+color, use=xterm+sm+1006, use=vt220+pcedit,
+	use=teraterm4.59,
 teraterm5.0|Tera Term 5.0,
 	xenl,
 	rv=\E\\[>32;331;0c, use=bracketed+paste, use=dec+sl,
@@ -4503,6 +4507,8 @@ teraterm5.0|Tera Term 5.0,
 
 teraterm|Tera Term,
 	use=teraterm5.0,
+teraterm-256color|TeraTerm with xterm 256-colors,
+	use=xterm+256setaf, use=teraterm,
 
 #### RLogin
 # RLogin 2.30.4
@@ -4618,12 +4624,6 @@ ms-vt100-16color|VT-UTF-8 and VT100+,
 
 # Based on
 # https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences
-# We use this scheme to map function keys
-#       terminfo        modifier        code    keys
-#       kf13-kf24       shift           2       F1 to F12
-#       kf25-kf36       alt             3       F1 to F12
-#       kf37-kf48       control         4       F1 to F12
-#       kf49-kf60       ctrl-alt        7       F1 to F12
 #
 # Unclear: smam and rmam implemented?
 # Unclear: rmkx, smkx, rmir, smir - irrelevant?
@@ -4638,37 +4638,25 @@ ms-vt100-16color|VT-UTF-8 and VT100+,
 # +	Function keys... do not work consistently in telnet and ssh.  With
 #	telnet, kf1-kf4 are \EOP to \EOS, and kf5-kf12 match the terminfo.
 #	But with ssh, it's entirely different (reminds me of rxvt).
+#
+# JH:
+#	In version 10 22H2 (19045.6332), the function keys kf1-kf4 work
+#	consistently as \EOP to \EOS even in ssh, as well as shifted keys.
 winconsole|Windows 10 new console,
 	am, km, mir, msgr, xenl,
 	ncv@, U8#1,
 	acsc=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxy
 	     yzz~~,
 	bel=^G, blink@, cr=\r, ech=\E[%p1%dX, el1=\E[0K, ich1@, ind=\n,
-	invis@, is1=\E[!p, kf13=\E[11;2~, kf14=\E[12;2~,
-	kf15=\E[13;2~, kf16=\E[14;2~, 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[24;2~,
-	kf24=\E[25;2~, kf25=\E[11;3~, kf26=\E[12;3~,
-	kf27=\E[13;3~, kf28=\E[14;3~, kf29=\E[15;3~,
-	kf30=\E[17;3~, kf31=\E[18;3~, kf32=\E[19;3~,
-	kf33=\E[20;3~, kf34=\E[21;3~, kf35=\E[24;3~,
-	kf36=\E[25;3~, kf37=\E[11;4~, kf38=\E[12;4~,
-	kf39=\E[13;4~, kf40=\E[14;4~, kf41=\E[15;4~,
-	kf42=\E[17;4~, kf43=\E[18;4~, kf44=\E[19;4~,
-	kf45=\E[20;4~, kf46=\E[21;4~, kf47=\E[24;4~,
-	kf48=\E[25;4~, kf49=\E[11;7~, kf50=\E[12;7~,
-	kf51=\E[13;7~, kf52=\E[14;7~, kf53=\E[15;7~,
-	kf54=\E[17;7~, kf55=\E[18;7~, kf56=\E[19;7~,
-	kf57=\E[20;7~, kf58=\E[21;7~, kf59=\E[24;7~,
-	kf60=\E[25;7~, khome=\E[1~, nel=\r\n, ri=\E[T, rmacs=\E(B,
+	invis@, is1=\E[!p, kspd=^Z, nel=\r\n, ri=\E[T, rmacs=\E(B,
 	rmir@, rmpch@, rs1=\E[!p,
 	sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;m%?%p9%t
 	    \E(0%e\E(B%;,
-	sgr0=\E[0m\E(B, smacs=\E(0, smir@, smpch@, use=ansi+arrows,
-	use=ansi+csr, use=ansi+cup, use=ansi+erase, use=ansi+idc,
-	use=ansi+idl, use=ecma+index, use=ansi+inittabs,
-	use=ansi+local, use=ecma+sgr, use=ecma+color,
-	use=vt220+cvis, use=vt220+pcedit, use=xterm+nopcfkeys,
+	sgr0=\E[0m\E(B, smacs=\E(0, smir@, smpch@, use=linux+kbs,
+	use=ansi+csr, use=ansi+cup, use=ansi+erase, use=ansi+idc, use=ansi+idl,
+	use=ecma+index, use=ansi+inittabs, use=ansi+local, use=ecma+sgr,
+	use=ecma+color, use=vt220+cvis,	use=vt100+noapp, use=xterm+pcfkeys,
+	
 
 # Windows Terminal
 # https://github.com/microsoft/terminal
@@ -4999,7 +4987,7 @@ xterm-xf86-v32|xterm terminal emulator (XFree86 3.2 Window System),
 	use=ansi+idc, use=ansi+idl, use=ansi+inittabs,
 	use=ansi+local, use=ansi+rca2, use=xterm+alt47,
 	use=xterm+kbs, use=vt100+enq, use=xterm+r5+fkeys,
-	use=ecma+color, use=vt220+cvis, use=vt220+keypad,
+	use=ecma+color, use=vt220+cvis, use=vt100+keypad,
 	use=vt220+pcedit, use=vt220+sfkeys,
 
 # This is the stock xterm entry supplied with XFree86 3.3, which uses VT100
@@ -5072,10 +5060,11 @@ xterm-xfree86|xterm terminal emulator (XFree86),
 
 xterm+nofkeys|building block for xterm fkey-variants,
 	npc,
-	kcbt=\E[Z, nel=\EE, use=ecma+index, use=ansi+rep,
-	use=ecma+strikeout, use=vt420+lrmm, use=xterm+focus,
+	kcbt=\E[Z, kmnu=\E[29~, kMNU=\E[29;2~, kMNU3=\E[29;3~, kMNU4=\E[29;4~,
+	kMNU5=\E[29;5~, kMNU6=\E[29;6~, kMNU7=\E[29;7~,	nel=\EE, use=ecma+index,
+	use=ansi+rep, use=ecma+strikeout, use=vt420+lrmm, use=xterm+focus,
 	use=xterm+sm+1006, use=xterm+tmux, use=ecma+italics,
-	use=xterm+keypad, use=xterm-basic,
+	use=xterm+keypad+novt, use=xterm-basic,
 
 xterm-p370|xterm patch #370,
 	rv=\E\\[>41;[1-6][0-9][0-9];0c,
@@ -5143,7 +5132,8 @@ vt100+noapp|fragment with cursor keys in normal mode,
 	kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A,
 	use=vt100+noapp+pc,
 
-xterm+noapp|alias for vt100+noapp,
+xterm+noapp|xterm with cursor keys in normal mode,
+	kbeg=\E[E, kp5=\E[E,
 	use=vt100+noapp,
 
 xterm+app|fragment with cursor keys in application mode,
@@ -5222,6 +5212,19 @@ xterm+pcc0|fragment with modifyCursorKeys:0,
 	kLFT7=\EO7D, kRIT3=\EO3C, kRIT4=\EO4C, kRIT5=\EO5C,
 	kRIT6=\EO6C, kRIT7=\EO7C, kUP=\EO2A, kUP3=\EO3A,
 	kUP4=\EO4A, kUP5=\EO5A, kUP6=\EO6A, kUP7=\EO7A,
+#
+# Modified keypad keys are also from xterm patch #94:
+#
+xterm+pck0|fragment with modifyKeypadKeys:0,
+	kBEG=\E[1;2E, kBEG3=\E[1;3E, kBEG4=\E[1;4E, kBEG5=\E[1;5E,
+	kBEG6=\E[1;6E, kBEG7=\E[1;7E, kENT=\EO2M, kENT3=\EO3M, kENT4=\EO4M,
+	kENT5=\EO5M, kENT6=\EO6M, kENT7=\EO7M, kPSUB=\EO2m, kPSUB3=\EO3m,
+	kPSUB4=\EO4m, kPSUB5=\EO5m, kPSUB6=\EO6m, kPSUB7=\EO7m, kPADD=\EO2k,
+	kPADD3=\EO3k, kPADD4=\EO4k, kPADD5=\EO5k, kPADD6=\EO6k, kPADD7=\EO7k,
+	kPMUL=\EO2j, kPMUL3=\EO3j, kPMUL4=\EO4j, kPMUL5=\EO5j, kPMUL6=\EO6j,
+	kPMUL7=\EO7j, kPDIV=\EO2o, kPDIV3=\EO3o, kPDIV4=\EO4o, kPDIV5=\EO5o,
+	kPDIV6=\EO6o, kPDIV7=\EO7o, kPEQU=\EO2X, kPEQU3=\EO3X, kPEQU4=\EO4X,
+	kPEQU5=\EO5X, kPEQU6=\EO6X, kPEQU7=\EO7X, 
 
 #
 # Here are corresponding fragments from xterm patch #216:
@@ -5313,21 +5316,22 @@ xterm+alt+title|xterm 90 and 251 features combined,
 # directly related to VT100.
 #
 # With the VT220 keypad block that uses the 1-9 keys as suggested in
-# terminfo(5), the other keys can be handled with user-defined capabilities:
+# terminfo(5), the other keys can be handled with user-defined capabilities.
+# This applies to xterm in Sun/PC to VT220 emulation (sunKeyboard) mode:
 #
-#   _______________________________________
+#   ______________________________________
 #  | NumLock |    /    |    *    |    -    |
-#  |         |   $Oo   |   $Oj   |   $OS   |
+#  |         |   $Oo   |   $Oj   |   $Om   |
 #  |_________|__kpDIV__|__kpMUL__|__kpSUB__|
-#  |    7         8         9    |    +    |
+#  |    7    |    8    |    9    |    +    |
 #  |   $Ow   |   $Ox   |   $Oy   |   $Ok   |
-#  |_ka1__K1_|_________|_ka3__K3_|  kpADD  |
+#  |_ka1__K1_|___ka2___|_ka3__K3_|  kpADD  |
 #  |    4    |    5    |    6    |         |
 #  |   $Ot   |   $Ou   |   $Ov   |         |
-#  |_________|_kb2__K2_|_________|_________|
+#  |___kb1___|_kb2__K2_|___kb3___|_________|
 #  |    1    |    2    |    3    |         |
 #  |   $Oq   |   $Or   |   $Os   |         |
-#  |_kc1__K4_|_________|_kc3__K5_|  enter  |
+#  |_kc1__K4_|___kc2___|_kc3__K5_|  enter  |
 #  |         0         |    .    |   $OM   |
 #  |        $Op        |   $On   |         |
 #  |_______kpZRO_______|__kpDOT__|_kent_@8_|
@@ -5338,15 +5342,47 @@ xterm+alt+title|xterm 90 and 251 features combined,
 # kpCMA (comma) is used here for the VT100 keypad, which xterm emulates with
 # shifted-keypad-plus, though normally that invokes a font-size change.
 #
+# This layout applies to xterm in normal PC-Style (non-sunKeyboad) mode:
+#   ______________________________________
+#  | NumLock |    /    |    *    |    -    |
+#  |         |   $Oo   |   $Oj   |   $Om   |
+#  |_________|__kpDIV__|__kpMUL__|__kpSUB__|
+#  |    7    |    8    |    9    |    +    |
+#  | ~ Home  | ~ Up    | ~ PgUp  |   $Ok   |
+#  |_________|_________|_________|  kpADD  |
+#  |    4    |    5    |    6    |         |
+#  | ~ Left  |   $[E   | ~ Right |         |
+#  |_________|_kbeg_@1_|_________|_________|
+#  |    1    |    2    |    3    |         |
+#  | ~ End   | ~ Down  | ~ PgDn  |         |
+#  |_________|_________|_________| ~ Return|
+#  |         0         |    .    |         |
+#  |       ~ Ins       | ~ Del   |         |
+#  |___________________|_________|_________|
+#
+# Keys prefixed with ~ mean that it produces respective non-keypad key.
+#
+# Key 5 produces $OE instead of $[E in Application Cursor Mode, which is
+# currently undocumented behavior.
+#
 # Old versions of xterm, e.g., xterm-xfree86, documented \EOE as kb2, which
 # does not fit into this layout.  The extension kp5 fits, but is not visible
 # to termcap applications.  As an alternative, kbeg (which does have a termcap
 # equivalent) is provided.
 #
-xterm+keypad|xterm emulating VT100/VT220 numeric keypad,
-	kbeg=\EOE, kp5=\EOE, kpADD=\EOk, kpCMA=\EOl, kpDIV=\EOo,
-	kpDOT=\EOn, kpMUL=\EOj, kpSUB=\EOm, kpZRO=\EOp,
-	use=vt220+keypad,
+xterm+keypad+noent|xterm numeric keypad keys (common w/o kent),
+	kpADD=\EOk, kpDIV=\EOo, kpMUL=\EOj, kbeg=\EOE, kp5=\EOE,
+	use=vt100+keypad,
+#
+xterm+keypad|xterm numeric keypad keys (common),
+	kent=\EOM, use=xterm+keypad+noent,
+#
+xterm+keypad+all|xterm numeric keypad keys (all),
+	kpSPC=\EO\s, kpTAB=\EOI, kpEQU=\EOX, use=xterm+keypad,
+#
+xterm+keypad+novt|xterm numeric keypad in all keyboard modes but Sun/PC (-sp),
+	@ka2, @kb1, @kb3, @kc2, @kpDOT, @kpZRO, @ka1, @kb2, @ka3, @kc1, @kc3,
+	use=xterm+pck0,	use=xterm+keypad+all,
 #
 # Those chunks use the new-style (the xterm oldFunctionKeys resource is false).
 # Alternatively, the same scheme with old-style function keys as in xterm-r6
@@ -5588,6 +5624,16 @@ xterm+direct16|xterm with direct-color indexing (16-color building-block),
 	      %;%;m,
 	setb@, setf@, use=xterm+direct,
 
+xterm+indirect16|xterm with direct-color indexing (16-color old legacy b-b),
+	CO#16,
+	setab=\E[%?%p1%{8}%<%t4%p1%d%e%?%p1%{16}%<%t%p1%{92}%+%d%e48
+	      ;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&
+	      %d%;%;m,
+	setaf=\E[%?%p1%{8}%<%t3%p1%d%e%?%p1%{16}%<%t%p1%'R'%+%d%e38;
+	      2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%d
+	      %;%;m,
+	setb@, setf@, use=xterm+direct,
+
 xterm-direct16|xterm with direct-colors and 16 indexed colors,
 	use=xterm+direct16, use=xterm,
 
@@ -5729,14 +5775,14 @@ xterm-sco|xterm with SCO function keys,
 #	+ maps numeric keypad "+" to ",".
 #	+ uses DEC-style control sequences for the application keypad.
 #
-xterm-vt220|xterm emulating VT220,
+xterm-vt220|xterm emulating VT220 keyboard,
 	npc,
 	kcbt=\E[Z, kend=\E[4~, khome=\E[1~, kmous=\E[M, nel=\EE,
-	use=xterm+app, use=xterm+edit, use=vt220+keypad,
+	use=xterm+app, use=xterm+edit, kpADD@, use=xterm+keypad+all,
 	use=ecma+italics, use=ecma+index, use=ansi+rep,
 	use=ecma+strikeout, use=vt220+sfkeys,
 	use=xterm+r5+fkeys, use=xterm+focus, use=xterm+sm+1006,
-	use=xterm+tmux, use=xterm+keypad, use=xterm-basic,
+	use=xterm+tmux, use=xterm-basic,
 
 xterm-vt52|xterm emulating DEC VT52,
 	acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
@@ -6069,7 +6115,7 @@ xtermm|xterm terminal emulator (monochrome),
 	tbc=\E[3g, use=ansi+apparrows, use=ansi+csr,
 	use=ansi+cup, use=ansi+erase, use=ansi+idl,
 	use=ansi+local, use=ansi+sgrso, use=decid+cpr,
-	use=vt100+fnkeys,
+	use=vt100+keypad,
 
 xtermc|xterm terminal emulator (color),
 	ncv#7,
@@ -6134,7 +6180,7 @@ color_xterm|cx|cx100|color_xterm color terminal emulator for X,
 	use=ecma+underline, use=ecma+standout,
 	use=xterm+r5+fkeys, use=ansi+apparrows, use=ansi+csr,
 	use=ansi+cup, use=ansi+idl, use=ansi+local,
-	use=decid+cpr, use=ecma+color, use=vt220+keypad,
+	use=decid+cpr, use=ecma+color, use=vt100+keypad,
 
 # The IRAF source has a terminfo using "xterm-r5", but line-drawing does not
 # work in that case.  This entry uses xterm+acs, to work around that problem.
@@ -6556,7 +6602,7 @@ kvt|KDE terminal,
 konsole-base|KDE console window (common),
 	bce, km@, npc, XT,
 	ncv@,
-	ech=\E[%p1%dX, flash=\E[?5h$<100/>\E[?5l, kf1@, kf10@,
+	ech=\E[%p1%dX, flash=\E[?5h$<100/>\E[?5l, kbeg=\E[E, kf1@, kf10@,
 	kf11@, kf12@, kf13@, kf14@, kf15@, kf16@, kf17@, kf18@, kf19@, kf2@,
 	kf20@, kf3@, kf4@, kf5@, kf6@, kf7@, kf8@, kf9@, kfnd@, kslt@,
 	rmam=\E[?7l, rs1=\Ec,
@@ -6730,8 +6776,8 @@ mlterm3|multi lingual terminal emulator 3.x,
 	use=ecma+strikeout, use=xterm+app, use=xterm+pcf2,
 	use=xterm+pcc2, use=xterm+pce2, use=xterm+meta,
 	use=xterm+alt+title, use=xterm+sm+1006,
-	use=vt100+pfkeys, use=bracketed+paste, use=mlterm2,
-	use=report+version,
+	use=xterm+keypad+noent, use=bracketed+paste,
+	use=mlterm2, use=report+version,
 
 # This is mlterm 2.9.3's mlterm.ti, with some additions/corrections -TD
 #
@@ -6760,7 +6806,9 @@ mlterm2|multi lingual terminal emulator 2.x,
 	dch=\E[%p1%dP, dch1=\E[P, ech=\E[%p1%dX, ed=\E[J, el=\E[K,
 	el1=\E[1K, enacs=, ich=\E[%p1%d@, ind=\n,
 	is2=\E7\E[r\E[m\E[?7h\E[?1;3;4;6l\E[4l\E8\E>, kbs=^?,
-	kcbt=\E[Z, kend=\EOF, kent=\EOM, kind=\EO1;2B, kmous=\E[M,
+	kcbt=\E[Z, kend=\EOF, kent=\EOM, kind=\EO1;2B, kmnu=\E[29~,
+	kMNU=\E[29;2~, kMNU3=\E[29;3~, kMNU4=\E[29;4~, kMNU5=\E[29;5~,
+	kMNU6=\E[29;6~, kMNU7=\E[29;7~,	kmous=\E[M,
 	kri=\EO1;2A, mc0=\E[i, nel=\EE, op=\E[39;49m, rev=\E[7m,
 	ri=\EM, rmacs=\E(B, rmam=\E[?7l, rmir=\E[4l,
 	rmkx=\E[?1l\E>, rs1=\Ec,
@@ -6834,7 +6882,7 @@ rxvt-basic|rxvt terminal base (X Window System),
 	use=ecma+underline, use=ecma+standout, use=ansi+csr,
 	use=ansi+idl, use=ansi+local, use=xterm+alt47,
 	use=vt100+enq, use=vt100+4bsd, use=rxvt+pcfkeys,
-	use=vt220+cvis, use=vt220+keypad,
+	use=vt220+cvis, use=vt100+keypad,
 
 # Key Codes from rxvt reference:
 #
@@ -7264,7 +7312,7 @@ mvterm|vv100|SwitchTerm aka mvTERM,
 	    %;m%?%p9%t\016%e\017%;,
 	sgr0=\E[m\017, smkx=\E[?1h\E=, smso=\E[7m, use=ansi+csr,
 	use=ansi+idl, use=ansi+local, use=ansi+sgrul,
-	use=xterm+alt47, use=vt100+fnkeys, use=vt100+4bsd,
+	use=xterm+alt47, use=vt100+pf1-pf4, use=vt100+4bsd,
 	use=x10term+sl,
 
 #### MTERM
@@ -7384,7 +7432,6 @@ st|stterm|aka simpleterm,
 # Reviewed 0.8.5 (Debian stable package "stterm"):
 # In tack,
 #	sends nothing for control- and alt-modifiers to function-keys
-#	does not support application-mode for numeric keypad
 # In vttest,
 #	identifies as a VT102
 #	SRM, DECTCEM and ECH work, but not DECSCA
@@ -7410,8 +7457,11 @@ st-0.8.5|simpleterm 0.8.5,
 #
 # This entry discards the ccc/initc capabilities from st-0.7 because they
 # belong in st-256color.
+#
+# Keyboard shortcut for full application keypad mode has changed to
+# Left Ctrl+Shift+Num Lock. -JH
 st-0.8|simpleterm 0.8,
-	kcbt@, kent@, oc=\E]104\007, Ms=\E]52;%p1%s;%p2%s\007,
+	kcbt@, oc=\E]104\007, Ms=\E]52;%p1%s;%p2%s\007,
 	kDN3=\E[1;3B, kDN5=\E[1;5B, kLFT3=\E[1;3D, kLFT5=\E[1;5D,
 	kNXT3=\E[6;3~, kNXT5=\E[6;5~, kPRV3=\E[5;3~,
 	kPRV5=\E[5;5~, kRIT3=\E[1;3C, kRIT5=\E[1;5C,
@@ -7428,7 +7478,7 @@ st-0.8|simpleterm 0.8,
 #	provided with the source is incorrect, since Se/Ss are mis-coded
 #	as booleans rather than strings.
 st-0.7|simpleterm 0.7,
-	kcbt@, kent@, Ms=\E]52;%p1%s;%p2%s\007, kDN3=\E[1;3B,
+	kcbt@, Ms=\E]52;%p1%s;%p2%s\007, kDN3=\E[1;3B,
 	kDN5=\E[1;5B, kLFT3=\E[1;3D, kLFT5=\E[1;5D,
 	kNXT3=\E[6;3~, kNXT5=\E[6;5~, kPRV3=\E[5;3~,
 	kPRV5=\E[5;5~, kRIT3=\E[1;3C, kRIT5=\E[1;5C,
@@ -7462,7 +7512,9 @@ st-0.7|simpleterm 0.7,
 #	http://git.suckless.org/st/log/st.info
 # Tmux unofficial extensions, see TERMINFO EXTENSIONS in tmux(1)
 # still has no function keys past kf36 (no combinations of modifiers)
-# no application keypad mode, e.g, kent.
+#
+# In application keypad mode, sends limited set of sequences (keypad arrows)
+# by default, but can be switched to full mode using Left Alt+Num Lock. -JH
 st-0.6|simpleterm 0.6,
 	bce, mir, npc, xenl, XT,
 	colors#8, pairs#64,
@@ -7474,8 +7526,7 @@ st-0.6|simpleterm 0.6,
 	flash=\E[?5h$<100/>\E[?5l, ich=\E[%p1%d@,
 	is2=\E[4l\E>\E[?1034l, kDC=\E[3;2~, kEND=\E[1;2F,
 	kHOM=\E[1;2H, kIC=\E[2;2~, kLFT=\E[1;2D, kNXT=\E[6;2~,
-	kPRV=\E[5;2~, kRIT=\E[1;2C, ka1=\E[1~, ka3=\E[5~, kb2=\EOu,
-	kbs=^?, kc1=\E[4~, kc3=\E[6~, kcbt=\E[Z, kclr=\E[3;5~,
+	kPRV=\E[5;2~, kRIT=\E[1;2C, kbeg=\E[E, kbs=^?, kcbt=\E[Z, kclr=\E[3;5~,
 	kdl1=\E[3;2~, ked=\E[1;5F, kel=\E[1;2F, khome=\E[1~,
 	kil1=\E[2;5~, kind=\E[1;2B, kmous=\E[M, kri=\E[1;2A,
 	krmir=\E[2;2~, mc0=\E[i, mc4=\E[4i, mc5=\E[5i,
@@ -7493,7 +7544,7 @@ st-0.6|simpleterm 0.6,
 	use=ecma+standout, use=ansi+apparrows, use=ansi+csr,
 	use=ansi+enq, use=ansi+idl, use=ansi+inittabs,
 	use=ansi+local, use=ansi+rca2, use=ansi+sgrbold,
-	use=vt100+4bsd, use=vt100+pfkeys, use=vt220+pcedit,
+	use=vt100+4bsd, use=xterm+keypad, use=vt220+pcedit,
 	use=ecma+index, use=xterm+alt1049, use=vt220+cvis,
 	use=xterm+sl, use=ecma+italics, use=ecma+strikeout,
 	use=bracketed+paste, use=xterm+pcf2,
@@ -7749,6 +7800,8 @@ terminology-1.0.0|EFL-based terminal emulator (1.0.0),
 terminology-1.8.1|EFL-based terminal emulator (1.8.1),
 	km@,
 	cvvis@, flash@, initc@, kcbt=\E[Z, rmm@, smm@, Ms@,
+	kbeg=\EOE, kmnu=\E[29~, kMNU=\E[29;2~, kMNU3=\E[29;3~, kMNU4=\E[29;4~,
+	kMNU5=\E[29;5~, kMNU6=\E[29;6~, kMNU7=\E[29;7~,
 	use=linux+kbs, use=ecma+index, use=xterm+256setaf,
 	use=ansi+rep, use=ecma+strikeout, use=xterm+focus,
 	use=xterm+sm+1006, use=xterm+pcfkeys, use=xterm+tmux,
@@ -8305,6 +8358,10 @@ wezterm|Wez's Terminal Emulator,
 	use=xterm+alt+title, use=xterm+focus, use=xterm+pcc2,
 	use=xterm+pce2, use=xterm+pcf2, use=xterm+sl-alt,
 	use=xterm+sm+1006, use=xterm+tmux,
+wezterm-direct|Wez's Terminal Emulator with direct colors,
+	use=xterm+direct, use=wezterm,
+wezterm-direct16|Wez's Terminal Emulator with direct colors (16 indexed),
+	use=xterm+direct16, use=wezterm,
 
 #### Contour
 # https://github.com/contour-terminal/contour
@@ -8866,7 +8923,7 @@ screen.rxvt|screen in rxvt,
 	bw, XT,
 	cvvis@, flash@, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC,
 	kcuu1=\EOA, use=screen+fkeys, use=vt100+enq,
-	use=rxvt+pcfkeys, use=xterm+x11mouse, use=vt220+keypad,
+	use=rxvt+pcfkeys, use=xterm+x11mouse, use=vt100+keypad,
 	use=screen,
 screen.Eterm|screen in Eterm,
 	use=xterm+x11mouse, use=screen+fkeys, use=Eterm,
@@ -13324,7 +13381,7 @@ wy75|wyse75|Wyse 75,
 	smkx=\E[?1l\E[?7h\E=, smso=\E[1t\E[7m, smul=\E[2t\E[4m,
 	tsl=\E[>\,\001, use=ansi+arrows, use=ansi+cup,
 	use=ansi+local, use=ansi+pp, use=ansi+tabs,
-	use=decid+cpr, use=vt220+cvis, use=vt220+keypad,
+	use=decid+cpr, use=vt220+cvis, use=vt100+keypad,
 	use=vt220+sfkeys, use=vt220+ufkeys,
 #
 #	This terminal description uses the non-hidden attribute mode
@@ -13385,7 +13442,7 @@ wy85|wyse85|Wyse 85,
 	use=ansi+csr, use=ansi+inittabs, use=ansi+local,
 	use=ansi+pp, use=ansi+sgrbold, use=decid+cpr,
 	use=vt100+4bsd, use=vt220+vtedit, use=vt220+cvis,
-	use=vt220+keypad, use=vt220+sfkeys, use=vt220+ufkeys,
+	use=vt100+keypad, use=vt220+sfkeys, use=vt220+ufkeys,
 #
 #	Wyse 85 with visual bell.
 wy85-vb|wyse85-vb|Wyse 85 with visible bell,
@@ -13439,7 +13496,7 @@ wy85-8bit|wyse85-8bit|Wyse 85 in 8-bit mode,
 	tsl=\E[40h\E7\E[25;%i%p1%dH, use=ansi+csr,
 	use=ansi+inittabs, use=ansi+local, use=ansi+pp,
 	use=ansi+sgrbold, use=decid+cpr, use=vt100+4bsd,
-	use=vt100+pfkeys, use=vt220+cvis,
+	use=vt100+keypad, use=vt220+cvis,
 #
 #	Wyse 185 emulating a VT320 7 bit mode.
 #
@@ -13476,7 +13533,7 @@ wy185|wyse185|Wyse 185,
 	use=ecma+underline, use=ecma+standout, use=ansi+arrows,
 	use=ansi+inittabs, use=ansi+local, use=ansi+pp,
 	use=ansi+sgrbold, use=decid+cpr, use=vt100+4bsd,
-	use=vt220+vtedit, use=vt220+keypad, use=vt220+sfkeys,
+	use=vt220+vtedit, use=vt100+keypad, use=vt220+sfkeys,
 	use=vt220+ufkeys, use=wyse+cvis,
 #
 #	Wyse 185 with 24 data lines and top status (terminal status)
@@ -13675,7 +13732,7 @@ wy370|wyse370|wy370-101k|Wyse 370 with 101 key keyboard,
 wy370-105k|Wyse 370 with 105 key keyboard,
 	kfnd=\E[1~, khlp=\E[28~, khome=\E[26~, lf1=PF1, lf2=PF2,
 	lf3=PF3, lf4=PF4, use=ansi+arrows, use=vt220+vtedit,
-	use=wy370-nk, use=vt220+keypad, use=vt220+sfkeys,
+	use=wy370-nk, use=vt100+keypad, use=vt220+sfkeys,
 	use=vt220+ufkeys,
 #
 #	Function key set for the PC compatible keyboard
@@ -13801,7 +13858,7 @@ wy520|wyse520|Wyse 520,
 	use=ecma+underline, use=ansi+arrows, use=ansi+csr,
 	use=ansi+cup, use=ansi+local, use=ansi+pp,
 	use=ansi+sgrbold, use=ansi+tabs, use=decid+cpr,
-	use=vt220+vtedit, use=vt220+keypad, use=vt220+sfkeys,
+	use=vt220+vtedit, use=vt100+keypad, use=vt220+sfkeys,
 	use=vt220+ufkeys, use=wyse+cvis,
 #
 #       Wyse 520 with 24 data lines and status (terminal status)
@@ -14342,7 +14399,7 @@ v5410|att5410 in terms of a VT100,
 	sgr0=\E[m\017$<2>, smacs=^N, smam=\E[?7h, smkx=\E[?1h\E=,
 	smso=\E[1;7m$<2>, smul=\E[4m$<2>, tbc=\E[3g,
 	use=ansi+csr, use=ansi+idl1, use=decid+cpr,
-	use=vt100+fnkeys,
+	use=vt100+keypad,
 
 #
 # Teletype Model 5420 -- A souped up 5410, with multiple windows,
@@ -17791,7 +17848,7 @@ ts100|ts100-sp|Falco ts100-sp,
 	rmkx=\E[?1l\E>,
 	rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, smam=\E[?7h,
 	smkx=\E[?1h\E=, use=ansi+csr, use=ansi+local,
-	use=decid+cpr, use=vt100+4bsd, use=vt100+fnkeys,
+	use=decid+cpr, use=vt100+4bsd, use=vt100+keypad,
 
 ts100-ctxt|Falco ts-100 saving context,
 	rmcup=\E~_b, smcup=\E~_d\E[2J, use=ts100,
@@ -19636,7 +19693,7 @@ ncr260vt100an|NCR 2900/260 VT100 with ANSI keyboard,
 	smkx=\E[?1h\E=, smso=\E[1;7m, tbc=\E[3g,
 	vpa=\E[%p1%dd$<40>, use=ansi+csr, use=ansi+sgrbold,
 	use=decid+cpr, use=vt220+vtedit, use=vt220+cvis,
-	use=vt220+keypad, use=ncr260vt+sl,
+	use=vt100+keypad, use=ncr260vt+sl,
 
 ncr260vt+sl|NCR 2900/260 VT100 status line,
 	hs,
@@ -19697,7 +19754,7 @@ ncr260vt200an|NCR 2900/260 VT200 with ANSI keyboard,
 	smir=\E[4h, smkx=\E[?1h\E=, tbc=\E[3g,
 	vpa=\E[%p1%dd$<40>, use=ecma+underline,
 	use=ecma+standout, use=ansi+sgrbold, use=decid+cpr,
-	use=vt220+vtedit, use=vt220+cvis, use=vt220+keypad,
+	use=vt220+vtedit, use=vt220+cvis, use=vt100+keypad,
 	use=ncr260vt+sl, use=vt220+sfkeys, use=vt220+ufkeys,
 
 ncr260vt200wan|NCR 2900/260 VT200 wide mode ANSI keyboard,
@@ -19752,7 +19809,7 @@ ncr260vt300an|NCR 2900/260 VT300 with ANSI keyboard,
 	smir=\E[4h, smkx=\E[?1h\E=, tbc=\E[3g,
 	vpa=\E[%p1%dd$<40>, use=ecma+underline,
 	use=ecma+standout, use=ansi+sgrbold, use=decid+cpr,
-	use=vt220+vtedit, use=vt220+cvis, use=vt220+keypad,
+	use=vt220+vtedit, use=vt220+cvis, use=vt100+keypad,
 	use=ncr260vt+sl, use=vt220+sfkeys, use=vt220+ufkeys,
 
 ncr260vt300wan|NCR 2900/260 VT300 wide mode ANSI keyboard,
@@ -20531,7 +20588,7 @@ tek4105-30|Tektronix 4015 emulating 30 line VT100,
 	kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, rmam=\E[?7l,
 	rmkx=\E[?1l\E>, rmso=\E[m$<2>, smam=\E[?7h,
 	smkx=\E[?1h\E=, use=ansi+csr, use=ansi+local,
-	use=vt100+4bsd, use=vt100+fnkeys,
+	use=vt100+4bsd, use=vt100+keypad,
 
 # Tektronix 4105 from BRL
 # The following setup modes are assumed for normal operation:
@@ -24446,7 +24503,7 @@ xtalk|IBM PC with xtalk communication program (versions up to 3.4),
 	rmkx=\E[?1l\E>, rmso=\E[m\s,
 	rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sgr0=\E[m,
 	smacs=^N, smam=\E[?7h, smkx=\E[?1h\E=, smso=\E[7m\s,
-	tbc=\E[3g, use=ansi+local, use=vt100+fnkeys,
+	tbc=\E[3g, use=ansi+local, use=vt100+pf1-pf4,
 
 # The official PC terminal emulator program of the AT&T Product Centers.
 # Note - insert mode commented out - doesn't seem to work on AT&T PC.
@@ -25499,7 +25556,7 @@ v3220|LANPAR Vision II model 3220/3221/3222,
 #	https://invisible-island.net/ncurses/ncurses-netbsd.html
 #
 # ncurses makes explicit checks for a few user-definable capabilities:  AX, E3,
-# RGB, U8, XM, which are documented in the user_caps(5) manual page.
+# NQ, RGB, U8, XM, xm, which are documented in the user_caps(5) manual page.
 #
 #### SCREEN Extensions:
 #
@@ -25573,13 +25630,38 @@ v3220|LANPAR Vision II model 3220/3221/3222,
 # A few terminals provide similar functionality (sending distinct keys when
 # a modifier is used), including rxvt.
 #
-# These are the extended keys defined in this file:
-#
-# kDC3 kDC4 kDC5 kDC6 kDC7 kDN kDN3 kDN4 kDN5 kDN6 kDN7 kEND3 kEND4 kEND5 kEND6
-# kEND7 kHOM3 kHOM4 kHOM5 kHOM6 kHOM7 kIC3 kIC4 kIC5 kIC6 kIC7 kLFT3 kLFT4
-# kLFT5 kLFT6 kLFT7 kNXT3 kNXT4 kNXT5 kNXT6 kNXT7 kPRV3 kPRV4 kPRV5 kPRV6 kPRV7
-# kRIT3 kRIT4 kRIT5 kRIT6 kRIT7 kUP kUP3 kUP4 kUP5 kUP6 kUP7 kxIN kxOUT ka2 kb1
-# kb3 kc2
+# These are the extended keys defined in this file, possibly in regex format:
+#
+# kDC[3-7]		delete-character key (shifted variants)
+# kDN[3-7]?		down-arrow key (shifted variants)
+# kEND[3-7]		end key (shifted variants)
+# kENT[3-7]?		enter/send key (shifted variants)
+# kHOM[3-7]		home key (shifted variants)
+# kIC[3-7]		insert-character key (shifted variants)
+# kLFT[3-7]		left-arrow key (shifted variants)
+# kNXT[3-7]		next-page key (shifted variants)
+# kPRV[3-7]		previous-page key (shifted variants)
+# kRIT[3-7]		right-arrow key (shifted variants)
+# kUP[3-7]?		up-arrow key (shifted variants)
+# ka2, kA2[3-7]?	keypad 2 / up-arrow key (with shifted variants)
+# kb1, kB1[3-7]?	keypad 4 / left-arrow key (with shifted variants)
+# kb3, kB3[3-7]?	keypad 6 / right-arrow key (with shifted variants)
+# kc2, kC2[3-7]?	keypad 8 / down-arrow key (with shifted variants)
+# kmnu, kMNU[3-7]?	Menu key (with shifted variants)
+# kp[1-9]		duplicate of k[abc][123], for backwards compatibility
+# kpADD, kPADD[3-7]?	keypad + key (with shifted variants)
+# kpCMA, kPCMA[3-7]?	keypad , key (with shifted variants)
+# kpDIV, kPDIV[3-7]?	keypad / key (with shifted variants)
+# kpDOT, kPDOT[3-7]?	keypad . key (with shifted variants)
+# kpEQU, kPEQU[3-7]?	keypad = key (with shifted variants)
+# kpMUL, kPMUL[3-7]?	keypad * key (with shifted variants)
+# kpNUM, kPNUM[3-7]?	keypad Num Lock key (with shifted variants)
+# kpSPC, kPSPC[3-7]?	keypad Space key (with shifted variants)
+# kpSUB, kPSUB[3-7]?	keypad - key (with shifted variants)
+# kpTAB, kPTAB[3-7]?	keypad Tab key (with shifted variants)
+# kpZRO, kPZRO[3-7]?	keypad 0 key (with shifted variants)
+# kxIN			focus-in pseudo key
+# kxOUT			focus-out pseudo key
 #
 # Bracketed paste is described with these capabilities in vim:
 #
@@ -27998,4 +28080,43 @@ v3220|LANPAR Vision II model 3220/3221/3222,
 # 2025-07-19
 #	+ add xterm+keypad to pccon+base -TD
 #
+# 2025-10-15
+# 	+ abandon incorrect vt100+keypad mappings for ka1-kc3 ("cross") keypad
+# 	  keys
+# 	+ since VT100 and VT220 have exactly the same numeric keypad and its
+#	  sequences, unify vt100+keypad and vt220+keypad, and rename references
+#	  from vt220+keypad to vt100+keypad
+#	+ add kpCMA, kpDOT, kpSUB, and kpZRO to vt100+keypad; also add
+#	  vt100+keypad+emul to emulate PF1-PF4 on top row of the keypad
+# 	+ correct xterm+keypad keys when in non-sunKeyboard mode
+# 	+ add kbeg, kp5 keys to xterm+noapp
+# 	+ add kmnu including shifted variants to xterm+nofkeys
+# 	+ add support for shifted keypad keys as xterm+pck0
+# 	+ modify xterm+keypad and add xterm+keypad+noent to serve as a common
+# 	  key set for other terminals; add xterm+keypad+all and
+# 	  xterm+keypad+novt for full-featured xterm and fix xterm-vt220
+# 	+ remove ncv from putty, since color support doesn't affect the features
+# 	+ add kbeg, kENT and kPADD keys to putty
+# 	+ add putty-xterm as the richest variant in terms of modified keys
+# 	+ add -direct and -direct16 for putty, putty-xterm, and wezterm,
+# 	  and -256color for putty-xterm
+# 	+ fix teraterm-4.97, which no longer emulates VT220 editing keys
+# 	  based on their physical locations
+# 	+ add support for xterm shifted keys to winconsole, fix kbs and kspd
+# 	+ set numpad 5 to kbeg instead of kb5 in linux-basic, matching xterm
+# 	+ set kspd (suspend key) to the Pause key instead of ^Z in linux-basic
+# 	+ add full VT100 keypad support to nsterm-7, as it is supported
+# 	+ remove unsupported keypad app mode from xnuppc-basic
+# 	+ add xterm-style keypad app mode to iTerm.app, mlterm3, and st
+#	+ add kbeg key to konsole-base and terminology
+#	+ add kmnu key to mlterm2+
+#	+ remove ka1-kc3 and kent keys, and add kbeg key to st
+#	+ remove VT100 keypad support (except PF1-PF4) from xtalk and mvterm,
+#	  since they don't support application keypad mode
+#	+ add full VT100 keypad support to wy85-8bit and tek4105-30, as they
+#	  support application keypad mode
+#	+ update documentation of caps described in user_caps(5) man page
+#	+ update documentation of key extended caps
+#	(all by Jakub Horky)
+#
 ######## SHANTIH!  SHANTIH!  SHANTIH!

Reply via email to