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

Re: Append cancelled commands to history



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Mon, Jul 06, 2009 at 05:16:42PM +0200, Vadim Zeitlin wrote:
>  Hello,
>
>  I've been using this tip since the day it was posted here and it worked
> great: pressing Ctrl-C is much more convenient/easier to remember than
> using a separate key combination for "cancel but save in history" that I
> used before, thanks Simon! However today I accidentally found out that
> pressing Ctrl-C on a line starting with '-' results in
>
>     TRAPINT:1: bad option: -
>
> error message. The fix for this is, of course, obvious but I thought to
> post it here just in case anybody else decides to copy this from the list
> archives to their .zshrc, so here is the updated function:
>
>     % which TRAPINT
>     TRAPINT () {
>         zle && print -s -- $BUFFER
>         return $1
>     }

Hi Vadim,

Thanks for the fix. I just updated my TRAPINT function.

>  Thanks again to Simon for the original tip!
> VZ

I'm glad you like it ;-)

Simon
- -- 
+ privacy is necessary
+ using http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iQIcBAEBCAAGBQJKU6bcAAoJEJL+/bfkTDL5/dcP/2U6iokXcnD/hLkGCIMndylJ
kkhgG2aHi/Ag7RlQh920CP3ApTVnLVb87rRlqglVV1OmBfanYHPpffeDr43nR1Wz
YI6TGU9Ak9g/Rt5deFEIAbR0wlg4CM8gKohlXpvKxZHi+AEr4toQKQo5T/Y/kWOm
xJ/xZLRipouytwsu9SD+t2F8/sKxHufvCdNr+JgiHL9rjjgF6uMwBu63tJ6YQIRn
wWQm2FAJMpwKAULCKcxRdGXRZhZRfvRB1yCD24uLlWN0xLDOLsFpchlW3xDdfG+1
fWJeAYn2Xhd4IISVvilAqq0g0DGWrtQI3+e4xb4UIIzFGiqPwoNLhaCK5oxPCcHh
FMa8dJKWaal3r9Nfc7w9/SeNoWbtdxHj/HxLdUtrO2ow4sZ9W68X2BgaF2b2vF4s
rM56fnRvlQqtA7MqYwBIRQv97ZL6QoIvwQyjwOvE2exD7hTtwHAm0fk3CMApixXR
56fdniiD5f/OtTAma72E72quc2naqURlthQWLsvAwanXEvAHy4vdkhkI+r2QoeVC
x4hSCkRLJ00SagSjX9+Ns86Tacj3RaWcvRpbjFqKIoXmYWtqQduL017Q24NP9dxJ
3T4g6zuTblju8rzQexMWBT4dd2TyrKmCb44MEABLU0Xy/1KyLRXZjD00egnRTBmH
zwSTYs9mmdYG3Wdk/kmc
=W7MA
-----END PGP SIGNATURE-----



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