summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--Src/Zle/zle_main.c8
2 files changed, 13 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index f347b542e..56198d5f6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,11 @@
2004-09-20 Bart Schaefer <schaefer@zsh.org>
- * 20387: Src/init.c, Src/zle_main.c: rather than counting the EOF
+ * 20388: Src/Zle/zle_main.c: arrange that "zle internal-widget"
+ called from a "zle -N" widget does not trip the ignoreeof warning.
+ This is the long-documented behavior, but may break old "zle -N"
+ widgets designed as wrappers around delete-char-or-list.
+
+ * 20387: Src/init.c, Src/Zle/zle_main.c: rather than counting EOF
keystrokes as in 20363, pretend that we received an EOF each time
the "use 'logout' to logout" warning is printed, and let the top-
level loop keep the count. This way, disabling the warning (by
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.");