zsh-workers
 help / color / mirror / code / Atom feed
* Ignoreeof warning message regression
@ 2019-02-12 17:47 ` David Bohman
  2019-02-12 18:34   ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: David Bohman @ 2019-02-12 17:47 UTC (permalink / raw)
  To: zsh-workers

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

This is an old regression, which apparently occurred between release 5.3.1
and 5.4 of zsh.

If you have the ignoreeof option set, and type a CTL-D to the shell, you
are supposed to get a warning message:

zsh: use 'exit' to exit.

Instead, a blank line is emitted. This was introduced by
commit 34656ec2f00d6669cef56afdbffdd90639d7b465, specifically the change to
Src/Zle/zle_main.c.

The problem occurs both on Ubuntu 18.04.1 running zsh 5.4.2 and macOS
10.12.6 running 5.4 forwards to 5.7.1. Stock macOS 10.12.6 contains zsh 5.2
and does not manifest the bug.

The problem disappears when the change to Src/Zle/zle_main.c is backed out.

index 3487b5d9f..71930f76b 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -1256,7 +1256,6 @@ zleread(char **lp, char **rp, int flags, int context,
char *init, char *finish)
     resetneeded = 0;
     fetchttyinfo = 0;
     trashedzle = 0;
-    clearflag = 0;
     raw_lp = lp;
     lpromptbuf = promptexpand(lp ? *lp : NULL, 1, NULL, NULL, &pmpt_attr);
     raw_rp = rp;

I am aware that backing this out may break other things, but perhaps it
might give a hint to someone who is familiar with this area of the code.

Thanks.

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

* Re: Ignoreeof warning message regression
  2019-02-12 17:47 ` Ignoreeof warning message regression David Bohman
@ 2019-02-12 18:34   ` Peter Stephenson
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Stephenson @ 2019-02-12 18:34 UTC (permalink / raw)
  To: zsh-workers

On Tue, 2019-02-12 at 09:47 -0800, David Bohman wrote:
> This is an old regression, which apparently occurred between release 5.3.1
> and 5.4 of zsh.
> 
> If you have the ignoreeof option set, and type a CTL-D to the shell, you
> are supposed to get a warning message:
> 
> zsh: use 'exit' to exit.
> 
> Instead, a blank line is emitted. This was introduced by
> commit 34656ec2f00d6669cef56afdbffdd90639d7b465, specifically the change to
> Src/Zle/zle_main.c.
> 
> The problem occurs both on Ubuntu 18.04.1 running zsh 5.4.2 and macOS
> 10.12.6 running 5.4 forwards to 5.7.1. Stock macOS 10.12.6 contains zsh 5.2
> and does not manifest the bug.
> 
> The problem disappears when the change to Src/Zle/zle_main.c is backed out.

Yes.  In this case we do need to remember the state of the command line
when we return to ZLE after passing nothing-very-much back to the main
shell --- the ^D was ignored but we told the main shell about it anyway,
then came back into ZLE expecting to pick up exactly where we left off,
meaning we shouldn't clear the message we printed and that the main
shell we briefly returned to knows nothing about...  It's not at all
clear that's sensible behaviour but refactoring the states of ZLE is
probably beyond anyone's capabilities at this point.

The original fix is here (zsh-workers/40305):
http://www.zsh.org/mla/workers/2017/msg00053.html

I'm not sure the change to zle_main.c there is the key one for the fix
as a whole --- backing it off doesn't appear to make the specific
problem (not the originally reported one in that thread) being addressed
there fail, and it may be the associated change to clearflag in
zle_refresh.c was the key one.

However, as there were various related issues associated with
asynchrohonous behaviour, it's hard to be sure.

In the absence of a test suite for this sort of not only interactive but
asynchronous behaviour (zpty is way out of its depth here), I'm tempted
to make that change and see what happens.

pws


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

* Re: Ignoreeof warning message regression
@ 2019-02-13 23:50 David Bohman
  0 siblings, 0 replies; 3+ messages in thread
From: David Bohman @ 2019-02-13 23:50 UTC (permalink / raw)
  To: zsh-workers

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

> On Tue, 2019-02-12 at 09:47 -0800, David Bohman wrote:
> > This is an old regression, which apparently occurred between release
5.3.1
> > and 5.4 of zsh.
> >
> > If you have the ignoreeof option set, and type a CTL-D to the shell, you
> > are supposed to get a warning message:
> >
> > zsh: use 'exit' to exit.
> >
> > Instead, a blank line is emitted. This was introduced by
> > commit 34656ec2f00d6669cef56afdbffdd90639d7b465, specifically the
change to
> > Src/Zle/zle_main.c.
> >
> > The problem occurs both on Ubuntu 18.04.1 running zsh 5.4.2 and macOS
> > 10.12.6 running 5.4 forwards to 5.7.1. Stock macOS 10.12.6 contains zsh
5.2
> > and does not manifest the bug.
> >
> > The problem disappears when the change to Src/Zle/zle_main.c is backed
out.
>
> Yes. In this case we do need to remember the state of the command line
> when we return to ZLE after passing nothing-very-much back to the main
> shell --- the ^D was ignored but we told the main shell about it anyway,
> then came back into ZLE expecting to pick up exactly where we left off,
> meaning we shouldn't clear the message we printed and that the main
> shell we briefly returned to knows nothing about... It's not at all
> clear that's sensible behaviour but refactoring the states of ZLE is
> probably beyond anyone's capabilities at this point.
> The original fix is here (zsh-workers/40305):
> http://www.zsh.org/mla/workers/2017/msg00053.html
> I'm not sure the change to zle_main.c there is the key one for the fix
> as a whole --- backing it off doesn't appear to make the specific
> problem (not the originally reported one in that thread) being addressed
> there fail, and it may be the associated change to clearflag in
> zle_refresh.c was the key one.
> However, as there were various related issues associated with
> asynchrohonous behaviour, it's hard to be sure.
> In the absence of a test suite for this sort of not only interactive but
> asynchronous behaviour (zpty is way out of its depth here), I'm tempted
> to make that change and see what happens.
> pws

Thanks. I'll admit that I am not familiar with the code.

I have installed the patched version on my system, and it seems to be
running fine.

David

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

end of thread, other threads:[~2019-02-14 13:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20190212174900epcas1p2f71b5f3bafef8ad73a95c1cdb1bf5f8c@epcas1p2.samsung.com>
2019-02-12 17:47 ` Ignoreeof warning message regression David Bohman
2019-02-12 18:34   ` Peter Stephenson
2019-02-13 23:50 David Bohman

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