To: vim_dev@googlegroups.com Subject: Patch 8.1.0142 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.0142 Problem: Xterm and vt320 builtin termcap missing keypad keys. Solution: Add the escape sequences. (Kouichi Iwamoto, closes #2973) Files: src/term.c *** ../vim-8.1.0141/src/term.c 2018-06-30 17:09:23.039956879 +0200 --- src/term.c 2018-07-03 17:14:08.563027961 +0200 *************** *** 671,677 **** /* * VT320 is working as an ANSI terminal compatible DEC terminal. * (it covers VT1x0, VT2x0 and VT3x0 up to VT320 on VMS as well) - * Note: K_F1...K_F5 are for internal use, should not be defined. * TODO:- rewrite ESC[ codes to CSI * - keyboard languages (CSI ? 26 n) */ --- 671,676 ---- *************** *** 723,728 **** --- 722,729 ---- {K_DOWN, IF_EB("\033[B", ESC_STR "[B")}, {K_RIGHT, IF_EB("\033[C", ESC_STR "[C")}, {K_LEFT, IF_EB("\033[D", ESC_STR "[D")}, + // Note: cursor key sequences for application cursor mode are omitted, + // because they interfere with typed commands: OA. {K_F1, IF_EB("\033[11~", ESC_STR "[11~")}, {K_F2, IF_EB("\033[12~", ESC_STR "[12~")}, {K_F3, IF_EB("\033[13~", ESC_STR "[13~")}, *************** *** 749,759 **** --- 750,772 ---- {K_END, IF_EB("\033[4~", ESC_STR "[4~")}, {K_PAGEUP, IF_EB("\033[5~", ESC_STR "[5~")}, {K_PAGEDOWN, IF_EB("\033[6~", ESC_STR "[6~")}, + // These sequences starting with O may interfere with what the user + // is typing. Remove these if that bothers you. {K_KPLUS, IF_EB("\033Ok", ESC_STR "Ok")}, /* keypad plus */ {K_KMINUS, IF_EB("\033Om", ESC_STR "Om")}, /* keypad minus */ {K_KDIVIDE, IF_EB("\033Oo", ESC_STR "Oo")}, /* keypad / */ {K_KMULTIPLY, IF_EB("\033Oj", ESC_STR "Oj")}, /* keypad * */ {K_KENTER, IF_EB("\033OM", ESC_STR "OM")}, /* keypad Enter */ + {K_K0, IF_EB("\033Op", ESC_STR "Op")}, /* keypad 0 */ + {K_K1, IF_EB("\033Oq", ESC_STR "Oq")}, /* keypad 1 */ + {K_K2, IF_EB("\033Or", ESC_STR "Or")}, /* keypad 2 */ + {K_K3, IF_EB("\033Os", ESC_STR "Os")}, /* keypad 3 */ + {K_K4, IF_EB("\033Ot", ESC_STR "Ot")}, /* keypad 4 */ + {K_K5, IF_EB("\033Ou", ESC_STR "Ou")}, /* keypad 5 */ + {K_K6, IF_EB("\033Ov", ESC_STR "Ov")}, /* keypad 6 */ + {K_K7, IF_EB("\033Ow", ESC_STR "Ow")}, /* keypad 7 */ + {K_K8, IF_EB("\033Ox", ESC_STR "Ox")}, /* keypad 8 */ + {K_K9, IF_EB("\033Oy", ESC_STR "Oy")}, /* keypad 9 */ {K_BS, "\x7f"}, /* for some reason 0177 doesn't work */ # endif *************** *** 960,965 **** --- 973,988 ---- {K_KMULTIPLY, IF_EB("\033O*j", ESC_STR "O*j")}, /* keypad * */ {K_KENTER, IF_EB("\033O*M", ESC_STR "O*M")}, /* keypad Enter */ {K_KPOINT, IF_EB("\033O*n", ESC_STR "O*n")}, /* keypad . */ + {K_K0, IF_EB("\033O*p", ESC_STR "O*p")}, /* keypad 0 */ + {K_K1, IF_EB("\033O*q", ESC_STR "O*q")}, /* keypad 1 */ + {K_K2, IF_EB("\033O*r", ESC_STR "O*r")}, /* keypad 2 */ + {K_K3, IF_EB("\033O*s", ESC_STR "O*s")}, /* keypad 3 */ + {K_K4, IF_EB("\033O*t", ESC_STR "O*t")}, /* keypad 4 */ + {K_K5, IF_EB("\033O*u", ESC_STR "O*u")}, /* keypad 5 */ + {K_K6, IF_EB("\033O*v", ESC_STR "O*v")}, /* keypad 6 */ + {K_K7, IF_EB("\033O*w", ESC_STR "O*w")}, /* keypad 7 */ + {K_K8, IF_EB("\033O*x", ESC_STR "O*x")}, /* keypad 8 */ + {K_K9, IF_EB("\033O*y", ESC_STR "O*y")}, /* keypad 9 */ {K_KDEL, IF_EB("\033[3;*~", ESC_STR "[3;*~")}, /* keypad Del */ {K_PS, IF_EB("\033[200~", ESC_STR "[200~")}, /* paste start */ {K_PE, IF_EB("\033[201~", ESC_STR "[201~")}, /* paste end */ *** ../vim-8.1.0141/src/version.c 2018-07-03 16:54:18.241509389 +0200 --- src/version.c 2018-07-03 17:09:33.568507424 +0200 *************** *** 791,792 **** --- 791,794 ---- { /* Add new patch number below this line */ + /**/ + 142, /**/ -- If Apple would build a car... ... it would be powered by the sun, be reliable, five times as fast and twice as easy to drive; but would only run on five percent of the roads. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///