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

Re: Why the widget bound to menuselect isn't called?

On Sat, Jul 13, 2019 at 5:20 AM Sebastian Gniazdowski
<sgniazdowski@xxxxxxxxx> wrote:
> The docs also say:
> "any other zle function  not  listed leaves menu selection and
> executes that function."
> so the widget should be apparently still plainly executed.

What you're missing is this bit:

Any key that is not defined in this keymap or that is bound to
`undefined-key' is looked up in the keymap currently selected.

That means you exit the menuselect keymap and return to the "current"
keymap before the binding for the keystroke is looked up; it doesn't
mean that the function looked up in the menuselect keymap is executed
after leaving.

> It seems to me that the main problem / idea is to replace the above
> check(s) which are keymap-specific to a more general solution

Menuselect is restricted in this way deliberately so that the user
can't perform any action that would garble the screen or confuse the
cursor placement.  The right thing would probably have been to create
a new set of widgets specific to menuselect and simply declare that
they couldn't be changed, but as a shortcut the most similar existing
actions were simply co-opted.

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