From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11393 invoked by alias); 3 Sep 2015 16:39:37 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 36416 Received: (qmail 6333 invoked from network); 3 Sep 2015 16:39:35 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-AuditID: cbfec7f4-f79c56d0000012ee-bb-55e877c36733 Date: Thu, 03 Sep 2015 17:39:05 +0100 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: Ctrl-c not working during correction with 5.1 Message-id: <20150903173905.5b53abd2@pwslap01u.europe.root.pri> In-reply-to: <87wpw9vuek.fsf@gmail.com> References: <20150901141031.GB423@x4> <150901111502.ZM2072@torch.brasslantern.com> <87wpw9vuek.fsf@gmail.com> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrCLMWRmVeSWpSXmKPExsVy+t/xy7qHy1+EGizpFrU42PyQyYHRY9XB D0wBjFFcNimpOZllqUX6dglcGXsmNzIVvOGvuDPpIVMD4z6eLkZODgkBE4kZp86xQdhiEhfu rQeyuTiEBJYySvQ+O8oM4cxgkliy5QkLhLOVUeLnkxYmkBYWAVWJSVe2sILYbAKGElM3zWYE sUUExCXOrj3PAmILC1hJbLy1jB3E5hWwl7j9ajXYOk4BdYlFa1aD9QoJ5EvsWPAcrJdfQF/i 6t9PTBAn2UvMvHKGEaJXUOLH5HtgM5kFtCQ2b2tihbDlJTavecsMMUdd4sbd3ewTGIVmIWmZ haRlFpKWBYzMqxhFU0uTC4qT0nMN9YoTc4tL89L1kvNzNzFCwvbLDsbFx6wOMQpwMCrx8E6Y /TxUiDWxrLgy9xCjBAezkghvRvaLUCHelMTKqtSi/Pii0pzU4kOM0hwsSuK8c3e9DxESSE8s Sc1OTS1ILYLJMnFwSjUwWt7cG6zQ92AG+5f9K6Kkazyr11owrPq8dQr3Letu1e9Gphv3Xnw4 qSJwj8jD6668HYsuW7yvOHaE635T5rLNv7ZeV1/vI5VygvEn+wyFS6xzJZVXzql2SXcI97ji vV2s+PCGjtfHneX5roQfzr4oK2qavzn82BHZ6cvj/mV5L5ULUo+a8bskUomlOCPRUIu5qDgR AFFM1EBXAgAA On Wed, 2 Sep 2015 15:10:43 +0200 Christian Neukirchen wrote: > zsh 5.1 (x86_64-unknown-linux-gnu) > zsh-5.1-0-g11189c6 > % zsh -f > juno% setopt NOALWAYSLASTPROMPT PROMPT_SUBST > juno% PS1='$(echo foo)%# ' > foo% ls /usr/share/man/man1/ > zsh: do you wish to see all 2528 possibilities (1264 lines)? n > $(echo ls /usr/share/man/man1/ > foo% > > Somehow the unevaluated PS1 is printed. I see what's happened --- in the old days we reset the error flag which cancelled both an error and interrupt; now it only cancels an error. However, this is one of the small number of special places where we don't want an interrupt to take us back to the original prompt --- it should simply cancel the query and redraw the line. I think if we do have an error or interrupt we should not be executing the recursive zrefresh() that was causing the bad prompt; that would have meant the interrupt took us back to a new prompt, which would presumably be the correct behaviour if we *didn't* reset the interrupt. I've added that, but I don't know anywhere the difference is visible now. pws diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c index 78046fb..0c28c0a 100644 --- a/Src/Zle/zle_refresh.c +++ b/Src/Zle/zle_refresh.c @@ -1761,7 +1761,8 @@ singlelineout: inlist = 1; listmatches(); inlist = 0; - zrefresh(); + if (!errflag) + zrefresh(); } if (showinglist == -1) showinglist = nlnct; diff --git a/Src/Zle/zle_utils.c b/Src/Zle/zle_utils.c index d1d3206..9751f7a 100644 --- a/Src/Zle/zle_utils.c +++ b/Src/Zle/zle_utils.c @@ -1183,6 +1183,11 @@ getzlequery(void) /* get a character from the tty and interpret it */ c = getfullchar(0); + /* + * We'll interpret an interruption here as only interrupting the + * query, not the line editor. + */ + errflag &= ~ERRFLAG_INT; if (c == ZWC('\t')) c = ZWC('y'); else if (ZC_icntrl(c) || c == ZLEEOF)