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

Re: TRAPINT breaks consecutive menu-complete



On Thu, Feb 6, 2025 at 8:10 AM Tomasz Pala <gotar@xxxxxxxxxx> 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.

> $ 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:

     The return status from the function is handled specially.  If it is
     zero, the signal is assumed to have been handled, and execution
     continues normally.  Otherwise, the shell will behave as
     interrupted except that the return status of the trap is retained.




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