In my current machine, I use Vim 8.1 in a Ubuntu 18's default terminal (Vim is running with TERM=xterm256-color, which is a requirement for me). Everything works perfectly, with the exception of the fact that the keyboard's Numpad numerical keys do not work Vim's Normal Mode
(as a test, I see that they do work in GVim). For instance, it does not matter what mappings I try to use them in, nothing happens. But if I open GVim and try there, they work perfectly.
I have found multiple questions in multiple Stackexchange sites and also eslewhere, but they all talk about very particular cases. For instance, this one has seemingly good solutions for Mac OS users of Vim with TERM=xterm, while this one teaches how to solve this problem in case it appears when using Ubuntu in a virtual machine. This one teaches how to solve the problem when using Vim in SecureCRT terminals. Many describe how to solve the problem for PuTTy (e.g. this Vim Wiki). Also, it is easy to find online many suggestions of crazy keybindings that are supposed to solve the problem.
None of those worked for me. What is more surprising, I see no mention anywhere about how one would solve this problem when using Vim Ubuntu's default terminal (with Vim's TERM=xTerm256-color).
Hence me asking for help on that task. How could I try solving this issue?
EDIT: One example that might be informative is the following. Suppose that I include in my .vimrc
:
set showcmdnnoremap <k4> :echom "4-left"<CR>nnoremap <k8> :echom "8-up"<CR>nnoremap <k6> :echom "6-right"<CR>nnoremap <k2> :echom "2-down"<CR>
Then, suppose that I start GVim and hit the Numpad keys 4, 8, 8 and 6, in that order. In the left of the bottom bar I will see "4-left", "8-up", "8-up" and 6-right" (i.e. mappings worked), in that order and in the right of the bottom bar I will see 4, 8, 8 and then 6 appearing, in that order.
Now, suppose that I open Vim and again hit the Numpad keys 4, 8, 8 and 6, in that order. Nothing shows up in the left of the bottom bar (no command is issued) and in the right of the bottom bar the number 4886 appears.