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

Re: prompts with newlines get printed twice



On Sun, 25 Sep 2011 14:44:16 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> I've traced this to adjustwinsize() called from zhandler().  It makes
> these two calls:
> 
> 1694            zleentry(ZLE_CMD_REFRESH);
> 1695            zleentry(ZLE_CMD_RESET_PROMPT);
> 
> The first one calls zrefresh() which erases the current line and then
> prints the prompt (lines 1126 - 1129 of zle_refresh.c) and calls
> fflush(shout).  The second then goes through redisplay(), which moves
> up one line to the beginning of the just-printed prompt and sets
> resetneeded, but the prompt is never printed nor is shout flushed.
> 
> Can anyone think of a reason not to swap the order of those calls in
> adjustwinsize()?

It does seem a strange order.  You'd have thought that at the least it
should ensure the prompt is output.  That rather confusing "redisplay"
call in zle_resetprompt, which I don't think does actually redisplay
anything, isn't helping clarify matters.

-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



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