zsh-workers
 help / color / mirror / code / Atom feed
* Signal handlers and Re: Behaviour of zle list-choices
       [not found]     ` <20160228135652.GB2953@master>
@ 2016-02-29 18:47       ` Bart Schaefer
  0 siblings, 0 replies; only message in thread
From: Bart Schaefer @ 2016-02-29 18:47 UTC (permalink / raw)
  To: zsh-workers, Joe M

On Feb 28,  7:56am, Joe M wrote:
}
} > type -a -f TRAPINT
} > TRAPINT () {
} >         ft_zle_state[minibuffer]=no
} >         ft-psvx-default
} >         zle reset-prompt 2> /dev/null
} >         return 127
} > }
} 
} Thanks for your suggestion. Removing the above TRAPINT fixed the
} issue that I am noticing.

OK, that helps.  The problem is with calling reset-prompt (really,
with calling redisplay, which is implied by reset-prompt) from the
signal handler.  The change to resetneeded and clearflag during the
handler causes ZLE to attempt twice to erase the list and move the
cursor back to the start of the prompt, which ends up moving too far
(though only erasing the list once, oddly enough).  It's as though
ZLE gets confused about the state of ALWAYS_LAST_PROMPT.

The following appears to fix it, though I only vaguely understand why.
Anyone care to shed some additional light before this gets committed?

diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c
index 7e4f328..aca676a 100644
--- a/Src/Zle/zle_refresh.c
+++ b/Src/Zle/zle_refresh.c
@@ -2435,8 +2435,8 @@ redisplay(UNUSED(char **args))
     moveto(0, 0);
     zputc(&zr_cr);		/* extra care */
     tc_upcurs(lprompth - 1);
-    resetneeded = 1;
-    clearflag = 0;
+    resetneeded = !showinglist;
+    clearflag = showinglist;
     return 0;
 }
 


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-02-29 18:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAHjjW16S5=2=qQrRhZUtgFOC5GUW28SnMHcqa=yCDk7Mdap2eA@mail.gmail.com>
     [not found] ` <56CFC947.1080507@gmx.com>
     [not found]   ` <20160228134000.GA2953@master>
     [not found]     ` <20160228135652.GB2953@master>
2016-02-29 18:47       ` Signal handlers and Re: Behaviour of zle list-choices Bart Schaefer

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).