zsh-workers
 help / color / mirror / code / Atom feed
* Prompt redrawing bug with ctrl-d
@ 2007-05-01  9:38 Mikael Magnusson
  2007-05-09 20:18 ` Andrey Borzenkov
  0 siblings, 1 reply; 4+ messages in thread
From: Mikael Magnusson @ 2007-05-01  9:38 UTC (permalink / raw)
  To: zsh-workers

Hello, noticed this a while ago.

% zsh -f
% setopt ignoreeof
% <ctrl-d>

zsh: use 'exit' to exit.

The prompt is now invisible.

-- 
Mikael Magnusson


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

* Re: Prompt redrawing bug with ctrl-d
  2007-05-01  9:38 Prompt redrawing bug with ctrl-d Mikael Magnusson
@ 2007-05-09 20:18 ` Andrey Borzenkov
  2007-05-10  6:02   ` Andrey Borzenkov
  0 siblings, 1 reply; 4+ messages in thread
From: Andrey Borzenkov @ 2007-05-09 20:18 UTC (permalink / raw)
  To: zsh-workers

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

On Tuesday 01 May 2007, Mikael Magnusson wrote:
> Hello, noticed this a while ago.
>
> % zsh -f
> % setopt ignoreeof
> % <ctrl-d>
>
> zsh: use 'exit' to exit.
>
> The prompt is now invisible.


message is displayed using showmsg() that sets "clearflag" which should tell 
zrefresh() to not clear until end of screen (to preserve message). 
Unfortunately this flag has side effect that zrefresh() does not redisplay 
prompt either and skips over it.

Unfortunately I do not see any easy way short of adding yet another flag. I 
have started git cvsimport to try bisect; have no idea how long it takes.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: Prompt redrawing bug with ctrl-d
  2007-05-09 20:18 ` Andrey Borzenkov
@ 2007-05-10  6:02   ` Andrey Borzenkov
  2007-05-10  9:38     ` Peter Stephenson
  0 siblings, 1 reply; 4+ messages in thread
From: Andrey Borzenkov @ 2007-05-10  6:02 UTC (permalink / raw)
  To: zsh-workers

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

On Thursday 10 May 2007, Andrey Borzenkov wrote:
> On Tuesday 01 May 2007, Mikael Magnusson wrote:
> > Hello, noticed this a while ago.
> >
> > % zsh -f
> > % setopt ignoreeof
> > % <ctrl-d>
> >
> > zsh: use 'exit' to exit.
> >
> > The prompt is now invisible.
>
> message is displayed using showmsg() that sets "clearflag" which should
> tell zrefresh() to not clear until end of screen (to preserve message).
> Unfortunately this flag has side effect that zrefresh() does not redisplay
> prompt either and skips over it.
>
> Unfortunately I do not see any easy way short of adding yet another flag. I
> have started git cvsimport to try bisect; have no idea how long it takes.

OK here is the attempt to fix it. It is using use_exit_printed as flag and 
moves its resetting a bit later, so flag is available in preprompt (where 
prompt was overwritten in case promptsp). If there are no objections I'll 
commit it.

P.S. git cvsimport still runs for over 9 hours now :)

Index: Src/init.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/init.c,v
retrieving revision 1.72
diff -u -p -r1.72 init.c
--- Src/init.c  8 Nov 2006 17:43:32 -0000       1.72
+++ Src/init.c  10 May 2007 05:58:39 -0000
@@ -123,6 +123,7 @@ loop(int toplevel, int justonce)
                errflag = 0;
            }
        }
+       use_exit_printed = 0;
        intr();                 /* interrupts on            */
        lexinit();              /* initialize lexical state */
        if (!(prog = parse_event())) {  /* if we couldn't parse a list */
@@ -1335,7 +1336,6 @@ zsh_main(UNUSED(int argc), char **argv)
     init_misc();

     for (;;) {
-       use_exit_printed = 0;
        /*
         * See if we can free up some of jobtab.
         * We only do this at top level, because if we are
Index: Src/utils.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/utils.c,v
retrieving revision 1.163
diff -u -p -r1.163 utils.c
--- Src/utils.c 26 Apr 2007 09:27:44 -0000      1.163
+++ Src/utils.c 10 May 2007 05:58:40 -0000
@@ -1156,7 +1156,7 @@ preprompt(void)
     int period = getiparam("PERIOD");
     int mailcheck = getiparam("MAILCHECK");

-    if (isset(PROMPTSP) && isset(PROMPTCR)) {
+    if (isset(PROMPTSP) && isset(PROMPTCR) && !use_exit_printed) {
        /* The PROMPT_SP heuristic will move the prompt down to a new line
         * if there was any dangling output on the line (assuming the terminal
         * has automatic margins, but we try even if hasam isn't set). */


[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: Prompt redrawing bug with ctrl-d
  2007-05-10  6:02   ` Andrey Borzenkov
@ 2007-05-10  9:38     ` Peter Stephenson
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Stephenson @ 2007-05-10  9:38 UTC (permalink / raw)
  To: zsh-workers

Andrey Borzenkov wrote:
> OK here is the attempt to fix it. It is using use_exit_printed as flag and
> moves its resetting a bit later, so flag is available in preprompt (where
> prompt was overwritten in case promptsp). If there are no objections
> I'll commit it.

I dream about a better interface from the main shell to zle, but this
is entirely in the spirit of what we have at the moment, so it'll do
fine (until we find there's some other reason to use the same flag).

> P.S. git cvsimport still runs for over 9 hours now :)

At some point I fixed a double trashzle() that was causing the prompt to
move down a line that had been obscured by a corresponding bug somewhere
else.  It may be a side effect of that.  I can't find it at the moment,
possibly because since it was mostly to delete things it's not obvious
in the annotation.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php

To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview


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

end of thread, other threads:[~2007-05-10  9:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-01  9:38 Prompt redrawing bug with ctrl-d Mikael Magnusson
2007-05-09 20:18 ` Andrey Borzenkov
2007-05-10  6:02   ` Andrey Borzenkov
2007-05-10  9:38     ` Peter Stephenson

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