Closed ivanbrennan closed 2 years ago
I found the solution in :help terminal-special-keys
.
Since the terminal emulator simulates an xterm, only escape sequences that both Vim and xterm recognize will be available in the terminal window. If you want to pass on other escape sequences to the job running in the terminal you need to set up forwarding.
Adding the following to my vim configuration did the trick:
tmap <expr> <M-n> SendToTerm("\<Esc>n")
tmap <expr> <M-p> SendToTerm("\<Esc>p")
func! SendToTerm(keys)
call term_sendkeys('', a:keys)
return ''
endf
man fzf
)I use alt-p and alt-n to navigate command history, so my FZF_DEFAULT_OPTS includes the following bindings:
and I've configured my terminal and vim to recognize these keys:
It used to work, but after a recent upgrade, it stopped working as expected. Now, it works if I call,
but if I call,
then rather than triggering history commands, the alt- bindings enter
ð
andî
characters in the search string, respectively.This is the commit that changed the behavior: 85ae7459103c3aeef39383d8c8a4fbbdb9fb5f64 It seems that the bindings don't work in a terminal buffer.
My previous (working) set up involved the following:
The new (broken) set up involves the following:
Both systems are running linux, specifically NixOS.
Any advice about how to debug this would be greatly appreciated :)