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

Re: Interrupt after first tabbing into a menu select clears prompt

On Fri, 15 Jan 2016 19:46:25 +0800
Leo Mao <leomao@xxxxxxxxxxxxxxxxxxxxx> wrote:
> I also encounter this regression. Is there any news about this?
> I can confirm that this problem only occurs when I interrupt right after
> tabbing into the list.

It looks like this ought to help with the issue in question.
There's probably a race if you hit ^C again very quickly.

Possibly zrefresh() ought to save, reset, and finally restore the
errflag, which could help in other places.  Either that, or it
should simply refuse to redraw until the error condition is reset.


diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index 29aaee8..0ccb885 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -2584,6 +2584,12 @@ domenuselect(Hookdef dummy, Chdata dat)
     	if (!do_last_key) {
 	    zmult = 1;
 	    cmd = getkeycmd();
+	    /*
+	     * On interrupt, we'll exit due to cmd being empty.
+	     * Don't propagate the interrupt any further, which
+	     * can screw up redrawing.
+	     */
+	    errflag &= ~ERRFLAG_INT;
 	    if (mtab_been_reallocated) {
 		do_last_key = 1;

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