Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Getting back a command after hitting CTRL-C
- X-seq: zsh-users 12966
- From: Stephane Chazelas <Stephane_Chazelas@xxxxxxxx>
- To: Mikael Magnusson <mikachu@xxxxxxxxx>
- Subject: Re: Getting back a command after hitting CTRL-C
- Date: Tue, 17 Jun 2008 13:38:12 +0100
- Cc: Zsh Users <zsh-users@xxxxxxxxxx>
- In-reply-to: <237967ef0806170528x3a563ca2i990a642a7d168311@xxxxxxxxxxxxxx>
- Mail-followup-to: Mikael Magnusson <mikachu@xxxxxxxxx>, Zsh Users <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <2d460de70806170505v24c8d557g146a73d2cd553bab@xxxxxxxxxxxxxx> <237967ef0806170512q29a269ceo799ae02a70dc8f45@xxxxxxxxxxxxxx> <2d460de70806170527m59a16377hb6919bc7ad8f65a3@xxxxxxxxxxxxxx> <237967ef0806170528x3a563ca2i990a642a7d168311@xxxxxxxxxxxxxx>
On Tue, Jun 17, 2008 at 02:28:42PM +0200, Mikael Magnusson wrote:
> 2008/6/17 Richard Hartmann <richih.mailinglist@xxxxxxxxx>:
> > On Tue, Jun 17, 2008 at 14:12, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> >
> >
> >> Bind kill-whole-line to some key and press that instead of ctrl-c, then
> >> you can get it back with a yank. If you have a hard time not pressing ctrl-c,
> >> try:
> >> trap true SIGINT
> >
> > 5 minutes with the trap show I can't cope with that enabled :p
> > Unfortunately, binding kill-whole-line to ^c does not work, so that is not
> > an option either.
>
> Well, that is the idea, every time it annoys you, you remember to use
> the other keybinding instead :). You can of course change the interrupt
> key with stty, but then you won't be able to interrupt actual commands with
> ctrl-c anymore.
[...]
which you could work around with some precmd/prexec hook I
suppose.
This seems to work:
trap 'zle kill-buffer; zle -R' INT
--
Stéphane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author