about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2004-09-20 14:03:36 +0000
committerBart Schaefer <barts@users.sourceforge.net>2004-09-20 14:03:36 +0000
commit5741e2840f4f905722f453d10a8efcd2486fd9fc (patch)
treec87a89f1c705470d29172161edc0ca6a685ddd27
parent2e9bbdc833ca50f4d1a4613c1e0f2035fc5f9561 (diff)
downloadzsh-5741e2840f4f905722f453d10a8efcd2486fd9fc.tar.gz
zsh-5741e2840f4f905722f453d10a8efcd2486fd9fc.tar.xz
zsh-5741e2840f4f905722f453d10a8efcd2486fd9fc.zip
20388: tweak ignoreeof behavior on user-defined widgets to match docs.
-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.");