Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: TRAPINT breaks consecutive menu-complete
- X-seq: zsh-users 30198
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Tomasz Pala <gotar@xxxxxxxxxx>
- Cc: zsh-users@xxxxxxx
- Subject: Re: TRAPINT breaks consecutive menu-complete
- Date: Thu, 6 Feb 2025 19:52:26 -0800
- Archived-at: <https://zsh.org/users/30198>
- In-reply-to: <20250206160947.GB13517@polanet.pl>
- List-id: <zsh-users.zsh.org>
- References: <20250206160947.GB13517@polanet.pl>
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