Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: exit after 10 EOF's
- X-seq: zsh-workers 20388
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: PATCH: exit after 10 EOF's
- Date: Sun, 19 Sep 2004 12:11:40 -0700 (PDT)
- In-reply-to: <20040919175211.3557D863A@xxxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <200409131118.i8DBIM5B005245@xxxxxxxxxxxxxx> <Pine.LNX.4.61.0409181943300.6971@xxxxxxxxxxxxxxxxxx> <D8064C1C-0A0F-11D9-A0DD-0003931123E4@xxxxxxxxxxxxxxxx> <Pine.LNX.4.61.0409190935150.6971@xxxxxxxxxxxxxxxxxx> <20040919175211.3557D863A@xxxxxxxxxxxxxxxxxxxxxxxx>
- Reply-to: zsh-workers@xxxxxxxxxx
On Sun, 19 Sep 2004, Peter Stephenson wrote:
> If we could somehow make it (without too much tortuous code) that any
> zle -N widget, no matter what it contains, suppresses the warning and
> the EOF behaviour, I would be fairly happy.
Here's the hunk for that. Line numbers are off because I haven't
committed 20387 yet, so this is not directly applicable via "patch".
@@ -887,10 +897,17 @@
} else if((w = func->widget)->flags & (WIDGET_INT|WIDGET_NCOMP)) {
int wflags = w->flags;
- if (keybuf[0] == eofchar && !keybuf[1] &&
+ /*
+ * The rule is that "zle -N" widgets suppress EOF warnings. When
+ * a "zle -N" widget invokes "zle another-widget" we pass through
+ * this code again, but with actual arguments rather than with the
+ * zlenoargs placeholder.
+ */
+ if (keybuf[0] == eofchar && !keybuf[1] && args == zlenoargs &&
!ll && isfirstln && (zlereadflags & ZLRF_IGNOREEOF)) {
showmsg((!islogin) ? "zsh: use 'exit' to exit." :
"zsh: use 'logout' to logout.");
Messages sorted by:
Reverse Date,
Date,
Thread,
Author