zsh-workers
 help / color / mirror / code / Atom feed
* Re: Interrupt after first tabbing into a menu select clears prompt
@ 2016-01-15 11:46 Leo Mao
  2016-01-15 12:43 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Leo Mao @ 2016-01-15 11:46 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 161 bytes --]

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Interrupt after first tabbing into a menu select clears prompt
  2016-01-15 11:46 Interrupt after first tabbing into a menu select clears prompt Leo Mao
@ 2016-01-15 12:43 ` Peter Stephenson
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Stephenson @ 2016-01-15 12:43 UTC (permalink / raw)
  To: zsh-workers

On Fri, 15 Jan 2016 19:46:25 +0800
Leo Mao <leomao@users.sourceforge.net> 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.

pws

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;
 		continue;


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Interrupt after first tabbing into a menu select clears prompt
@ 2015-12-27  5:48 Philip Sequeira
  0 siblings, 0 replies; 3+ messages in thread
From: Philip Sequeira @ 2015-12-27  5:48 UTC (permalink / raw)
  To: zsh-workers

This is a regression, been happening for a while but I never got
around to tracking it down.

>From zsh -f:
zstyle ':completion:*' menu select=0
autoload -Uz compinit
compinit
ls<Tab><Tab>^C

And the prompt disappears. As far as I can tell, it only happens if
you interrupt right after tabbing into the list, without doing
anything else. If you go to another entry, or even back to the first
one, before hitting ^C, it won't disappear.

Bisected to 32f5d3d8c16b4f3a11fa39c0ee378d72336ba853. Removing the if
(!errflag) added by that commit fixes my problem, but I guess you'll
want to add another check or something instead if you still think that
propagating an error should usually not redraw the line.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-01-15 12:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-15 11:46 Interrupt after first tabbing into a menu select clears prompt Leo Mao
2016-01-15 12:43 ` Peter Stephenson
  -- strict thread matches above, loose matches on Subject: below --
2015-12-27  5:48 Philip Sequeira

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).