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

Re: Getting back a command after hitting CTRL-C



On Tue, Jun 17, 2008 at 02:48:08PM +0200, Vincent Lefevre wrote:
> On 2008-06-17 13:38:12 +0100, Stephane Chazelas wrote:
> > This seems to work:
> > 
> > trap 'zle kill-buffer; zle -R' INT
> 
> But this badly interacts with the completion system. For instance,
> under Debian:
> 
> vin:~> trap 'zle kill-buffer; zle -R' INT
> vin:~> dpkg -s [TAB][Ctrl-C] (where the Ctrl-C is typed quickly enough)
> _deb_packages_update_installed:zle:6: widgets can only be called when ZLE is active
> vin:~[1]> dpkg -s
> zsh: do you wish to see all 2370 possibilities (1186 lines)? 
> 
> Then I type 'n' and get:
> 
> vin:~[1dpkg -s 
[...]

To be honest, I didn't quite expect it to work in the first
place, which is why I said "_seems_ to work". You can probably
adjust it to avoid those clashes though:

trap 'zle && zle kill-buffer && zle -R' INT

-- 
Stéphane



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