Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Bug with incremental search in menu-selection

Hey list,

I vaguely remembered, that it should be possible to use interactive
search in selection menus with the completion system. And sure enough,
the zshmodules(1) manual lists ‘history-incremental-search-forward‘ and
‘history-incremental-search-backward’ as widgets that start interactive
search if bound in the "menuselect" keymap. So I went ahead and added
bindings for those in my setup.

And if entered, I do indeed get dropped into an "isearch" prompt above
the completion menu. However pressing keys in that prompt produces
completely nonsensical results: A key-press doesn't insert the character
that the key usually produces and what's weirder is that it also
produces different characters when pressed more than once.

That felt like a bug and on IRC Mikael confirmed that it used to work
even until recently. So I bisected the issue down to the commit that
introduced breakage with this functionality.

The minimal setup I used:

zmodload zsh/complist
autoload -Uz compinit
zstyle ':completion:*' menu select
bindkey -e
bindkey '^i' complete-word
bindkey M menuselect '^f' history-incremental-search-forward

Then I entered a selection menu like "ls <TAB><TAB>" in that menu then
entered the isearch prompt by pressing "C-f" and then just tried to see
if I could use the prompt and it producing sensible results.

In the end of the bisection process, I arrived here:

# first bad commit: [e1c0a947cc845c71dd844db44016d07922cfcefa]
                    Read full multibyte string early for self-insert

That's workers-36496: http://www.zsh.org/mla/workers/2015/msg02418.html

I have next-to no idea about how zsh's input internals work, so that's
about as much as I can do about this. Maybe someone else has a better

Regards, Frank

In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
                                                  -- RFC 1925

Messages sorted by: Reverse Date, Date, Thread, Author