--- ncurses-6.5-20250830/misc/terminfo.src	2025-07-19 17:53:15.000000000 +0200
+++ ncurses-6.5-20250830-jho/misc/terminfo.src	2025-08-31 14:31:22.149076988 +0200
@@ -977,16 +977,18 @@ 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,
+	ind=\n, kbeg=\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,
+	smkx=\E[?1h\E=,	rmkx=\E[?1l\E>,
 	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,
-	use=ecma+standout, use=ansi+arrows, use=ansi+csr,
+	use=ecma+standout, use=ansi+apparrows, use=ansi+csr,
 	use=ansi+cup, use=ansi+erase, use=ansi+idc, use=ansi+idl,
 	use=ansi+local, use=ansi+rca2, use=vt220+pcedit,
 	use=vt102+enq, use=klone+sgr, use=ecma+color,
 	use=linux+lockeys, use=linux+sfkeys, use=vt220+ufkeys,
+	kpADD=\EOl, kpCMA@, kP5=\EOG, use=vt220+keypad+emul,
 
 # VT220 uses F1-F5 for "local" manipulation, normally not sending anything to
 # the host.  Rather than adapt the numbering scheme used by xterm, Linux used
@@ -2435,15 +2437,13 @@ vt52+arrows|cursor keys for VT52,
 # 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,
+vt100+keypad+legacy|DEC VT100 numeric keypad no fkeys (legacy),
 	ka1=\EOq, ka3=\EOs, kb2=\EOr, kc1=\EOp, kc3=\EOn,
-vt100+pf1-pf4|DEC VT100 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),
+vt100+pfkeys+legacy|DEC VT100 numeric keypad (kf1-kf4) (legacy),
+	kent=\EOM, use=vt100+pf1-pf4, use=vt100+keypad+legacy,
+vt100+fnkeys+legacy|DEC VT100 numeric keypad (kf0-kf10) (legacy),
 	kf0=\EOy, kf10=\EOx, kf5=\EOt, kf6=\EOu, kf7=\EOv, kf8=\EOl,
-	kf9=\EOw, use=vt100+pfkeys,
+	kf9=\EOw, use=vt100+pfkeys+legacy,
 #
 # 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
@@ -2455,20 +2455,33 @@ vt100+fnkeys|DEC VT100 numeric keypad (k
 #  |_kf1__k1_|_kf2__k2_|_kf3__k3_|_kf4__k4_|
 #  |    7         8         9         -    |
 #  |   $Ow   |   $Ox   |   $Oy   |   $Om   |
-#  |_ka1__K1_|_________|_ka3__K3_|_________|
+#  |_ka1__K1_|___ka2___|_ka3__K3_|__kpSUB__|
 #  |    4    |    5    |    6    |    ,    |
 #  |   $Ot   |   $Ou   |   $Ov   |   $Ol   |
-#  |_________|_kb2__K2_|_________|_________|
+#  |___kb1___|_kb2__K2_|___kb3___|__kpCMA__|
 #  |    1    |    2    |    3    |         |
 #  |   $Oq   |   $Or   |   $Os   |  enter  |
-#  |_kc1__K4_|_________|_kc3__K5_|  $OM    |
+#  |_kc1__K4_|___kc2___|_kc3__K5_|  $OM    |
 #  |         0         |   .     |         |
 #  |        $Op        |  $On    |         |
-#  |___________________|_________|_kent_@8_|
+#  |_______kpZRO_______|__kpDOT__|_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,
+# Note that ka2, kb1, kb3 and kc2 are extended caps which have no termcap
+# equivalent.
+#
+vt100+keypad|DEC VT100/VT220 numeric keypad (cross only),
+	ka1=\EOw, ka3=\EOy, kb2=\EOu, kc1=\EOq, kc3=\EOs,
+vt100+pf1-pf4|DEC VT100/VT220 PF1-PF4,
+	kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS,
+vt100+pfkeys|DEC VT100/VT220 numeric keypad (kf1-kf4),
+	kent=\EOM, use=vt100+pf1-pf4, use=vt100+keypad,
+vt100+fnkeys|vt220+keypad|DEC VT100/VT220 numeric keypad,
+	ka2=\EOx, kb1=\EOt, kb3=\EOv, kc2=\EOr,
+	kpCMA=\EOl, kpDOT=\EOn, kpSUB=\EOm, kpZRO=\EOp,
+	use=vt100+pfkeys,
+vt220+keypad+emul|DEC VT100/VT220 numeric keypad with PF1-PF4 emulation,
+	kpNUM=\EOP, kpDIV=\EOQ, kpMUL=\EOR, kpSUB=\EOS,
+	use=vt100+fnkeys,
 #
 vt100+enq|ncurses extension for VT100-style ENQ,
 	u8=\E[?1;2c, use=ansi+enq,
@@ -4220,7 +4233,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>,
@@ -4238,8 +4251,10 @@ 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,
 
 # 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 +4262,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, kpADD2=\EOm, use=vt220+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,
@@ -5143,7 +5159,8 @@ vt100+noapp|fragment with cursor keys in
 	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,
@@ -5313,21 +5330,22 @@ xterm+alt+title|xterm 90 and 251 feature
 # 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 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 +5356,44 @@ xterm+alt+title|xterm 90 and 251 feature
 # 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+kpextra|xterm non-VT100/VT220 numeric keypad keys,
+	kpADD=\EOk, kpDIV=\EOo, kpMUL=\EOj, 
+	kpSPC=\EO\s, kpTAB=\EOI, kpEQU=\EOX,
+#
+xterm+keypad|xterm numeric keypad in PC-Style mode,
+	kent=\EOM, kpCMA=\EOl, kpSUB=\EOm, kbeg=\EOE, kp5=\EOE,
+	use=xterm+kpextra, use=vt100+pf1-pf4,
+#
+xterm+keypad+vt220|xterm numeric keypad in VT220 (sunKeyboard) emulation mode,
+	use=xterm+kpextra, use=vt220+keypad,
 #
 # 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
@@ -5736,7 +5783,7 @@ xterm-vt220|xterm emulating VT220,
 	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+keypad+vt220, use=xterm-basic,
 
 xterm-vt52|xterm emulating DEC VT52,
 	acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
@@ -27998,4 +28045,16 @@ v3220|LANPAR Vision II model 3220/3221/3
 # 2025-07-19
 #	+ add xterm+keypad to pccon+base -TD
 #
+# 2025-08-31
+# 	+ abandon ancient vt100+keypad mapping for "cross" keypad keys (Jakub
+# 	  Horky)
+# 	+ unify vt100+keypad and vt220+keypad, and include extended caps
+# 	  for them (Jakub Horky)  
+# 	+ correct xterm+keypad keys when in non-vt220 (sunKeyboard) mode (Jakub
+# 	  Horky)
+# 	+ add kbeg, kp5 to xterm+noapp (Jakub Horky)
+# 	+ add Keypad & Cursor Application Mode to linux (Jakub Horky)
+# 	+ base putty+keypad on vt100/vt220 (Jakub Horky)
+# 	+ add putty-direct (Jakub Horky)
+#
 ######## SHANTIH!  SHANTIH!  SHANTIH!
