mptre / pick

A fuzzy search tool for the command-line
MIT License
814 stars 42 forks source link

Cursor keys don't work in rxvt-terminal with pick.vim #275

Closed ghost closed 6 years ago

ghost commented 6 years ago

... this is not an issue of pick.vim (or pick) but related to the keypad transmit mode:tmux always sends smkx to the terminal (https://github.com/tmux/tmux/commit/78ca1b02656808908e2c5dc19909966c3d3bb555), but this does not help with pick in vim ...

It works with xterm, but not with rxvt-unicode:

% infocmp -1 xterm | grep '[rs]mkx' 
    rmkx=\E[?1l\E>,
    smkx=\E[?1h\E=,
% infocmp -1 rxvt-unicode | grep '[rs]mkx'
    rmkx=\E>,
    smkx=\E=,

... with rxvt-unicode and pressing Left/Right:

% tput smkx; cat
^[[D^[[C

... now using the smkx-sequence from xterm with rxvt-unicode (and pressing Left/Right):

% echo -ne "\033[?1h"; tput smkx; cat
^[OD^[OC

... looks good, but seems that the smkx-sequence in rxvt-unicode is broken (or incomplete) ...

After reading https://github.com/robbyrussell/oh-my-zsh/pull/5113:

Switching to use smkx/rmkx application mode and terminfo for portability was a good idea: you're supposed to use portability libraries for stuff like this. But I think it's time to call it a failed experiment. Not because the implementation in OMZ was bad, but because terminfo and the various terminal programs out there don't have sufficient support for it.

the keypad transmit mode should be removed in pick and the ESC-sequences for the Cursor keys also hardcoded to these from xterm-terminfo: ^[OA, ^[OB, ^[OC, ^O[D ...

mptre commented 6 years ago

Closing for now.