Failing case 1:
vim --clean.:set cpo? and observe that it doesn't contain k. This should mean that Vim translates raw termcodes in mappings into internal keycodes.:set t_ku? and observe that it is set to ^[O*A.:map X ^[OA (like how :help cpo-k suggests; use CTRL-V ESC to type ^[)ia<CR>a<CR>a<CR>a<Esc> (that is, type four lines of a into the buffer, or whatever you wish)XXX and observe that the cursor goes up.:set t_ku=G and observe that the cursor goes back to the bottom.XXX and observe that a new line is opened above the last line and AXX is typed into it.Working case:
:set t_ku=^[OA (use CTRL-V ESC to type ^[)Failing case 2:
:set t_ku=^[OA (use CTRL-V ESC to type ^[):map X <Esc>OA (that is, < E s c > is typed with those 5 characters exactly)AXX is typed.Failing case 3:
:set t_ku=^[OA (use CTRL-V ESC to type ^[):map X ^[OAjk (use CTRL-V ESC to type ^[)AjkXX is typed.I believe failing case 1 is caused by find_term_bykeys not being able to find termcodes with modifier placeholders (like the * in ^[O*A). I believe failing case 3 is caused by replace_termcodes passing the whole (rest of) input into find_term_bykeys, which doesn't permit trailing text for a matching code.
Step 9 should move the cursor up in all cases. Vim should behave like :map X ^[OA and :map X <Esc>OA are the same as :map X <Up>, and :map X ^[OAjk is the same as :map X <Up>jk, as long as cpoptions doesn't contain k.
9.1.1918
Operating system:
"x86_64-linux"Linux 6.12.63, NixOS, 26.05 (Yarara), 26.05pre925861.ffbc9f8cbaacyesyesnix-env (Nix) 2.31.2+2"home-manager, nixos""home-manager"/nix/store/c126faazjcllyfyh28hhhgd97dajc9iq-nixos/nixosTerminal: XTerm(404)
Value of $TERM: xterm-256color
Shell: GNU bash, version 5.3.3(1)-release (x86_64-pc-linux-gnu)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()