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

PATCH Re: history-incremental-search-backward: ctrl-c doesn't interrupt

On May 17,  2:07am, Andrew Pimlott wrote:
} Subject: history-incremental-search-backward: ctrl-c doesn't interrupt
} I'm using 4.0.1-pre-4 as distributed in the Debian "testing"
} distribution.  Before Debian upgraded to the version 4 betas, I used
} ^C to cancel incremental history searches.  This has stopped
} working.

This has to do with the change we made to hold off on processing a signal
until we're at a "safe" spot in the code, to avoid corrupting memory.
However, any blocking read() from the terminal in ZLE ought to be safe.  

diff -u zsh-forge/current/Src/Zle/zle_main.c zsh-4.0/Src/Zle/zle_main.c
--- zsh-forge/current/Src/Zle/zle_main.c	Wed Mar 28 08:54:21 2001
+++ zsh-4.0/Src/Zle/zle_main.c	Thu May 17 08:33:14 2001
@@ -400,7 +400,10 @@
 	for (;;) {
+	    int q = queue_signal_level();
+	    dont_queue_signals();
 	    r = read(SHTTY, &cc, 1);
+	    restore_queue_signals(q);
 	    if (r == 1)
 	    if (r == 0) {

Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   

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