From 5741e2840f4f905722f453d10a8efcd2486fd9fc Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Mon, 20 Sep 2004 14:03:36 +0000 Subject: 20388: tweak ignoreeof behavior on user-defined widgets to match docs. --- Src/Zle/zle_main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Src/Zle') diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c index 2f78db1d1..dbe34a761 100644 --- a/Src/Zle/zle_main.c +++ b/Src/Zle/zle_main.c @@ -897,7 +897,13 @@ execzlefunc(Thingy func, char **args) } 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."); -- cgit 1.4.1