Re: TRAPINT breaks consecutive menu-complete
Tomasz Pala <[email protected]>
| Newsgroups | gmane.comp.shells.zsh.devel,gmane.comp.shells.zsh.user |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Feb 06, 2025 at 19:52:26 -0800, Bart Schaefer wrote: > On Thu, Feb 6, 2025 at 8:10???AM Tomasz Pala <[email protected]> wrote: >> >> $ ls [tab, tab -- starts menu completion] [ctrl-c] [tab, tab -- completion again] > > This is the expected/defined behavior -- interrupt takes you out of > completion and back to the "top" level keybindings. That's clear - but what is above "top" level keybinding? Because that's where TRAPINT directs: $ ls [tab, tab -- starts menu completion] [ctrl-c] [tab, tab - nothing happens, 3rd tab required] ^^^^^^^^^^^^^^^^ >> $ function TRAPINT { return 1; } > > If you want ^C to NOT take you out of completion, you have to return > zero from your trap. From the doc: I want ^C to take me out to the initial state, but it leaves something wrong - above function should not change completion behavior, but it does. BTW returning 0 also behaves badly, as it leaves completion on, yet clears the menu below, so the completion entries appear after movement (e.g. arrows) over each of them separately. -- Tomasz Pala <[email protected]>