about summary refs log tree commit diff
path: root/Src/init.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2006-09-17 17:42:56 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2006-09-17 17:42:56 +0000
commitb477e24aa267e57584db80796707184045f9885f (patch)
tree7094fe1cbe360c57e6a0dbcce2fa292d37d3f0b1 /Src/init.c
parentd8ce9807d4e2aaf29b709e707ed948c757c3ef3b (diff)
downloadzsh-b477e24aa267e57584db80796707184045f9885f.tar.gz
zsh-b477e24aa267e57584db80796707184045f9885f.tar.xz
zsh-b477e24aa267e57584db80796707184045f9885f.zip
22727: "use 'exit' to exit" was suboptimal
Diffstat (limited to 'Src/init.c')
-rw-r--r--Src/init.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/Src/init.c b/Src/init.c
index 9d6a0514e..50bdec59d 100644
--- a/Src/init.c
+++ b/Src/init.c
@@ -1245,6 +1245,13 @@ fallback_compctlread(char *name, UNUSED(char **args), UNUSED(Options ops), UNUSE
 }
 
 /*
+ * Used by zle to indicate it has already printed a "use 'exit' to exit"
+ * message.
+ */
+/**/
+mod_export int use_exit_printed;
+
+/*
  * This is real main entry point. This has to be mod_export'ed
  * so zsh.exe can found it on Cygwin
  */
@@ -1313,6 +1320,7 @@ zsh_main(UNUSED(int argc), char **argv)
     init_misc();
 
     for (;;) {
+	use_exit_printed = 0;
 	/*
 	 * See if we can free up some of jobtab.
 	 * We only do this at top level, because if we are
@@ -1343,7 +1351,13 @@ zsh_main(UNUSED(int argc), char **argv)
 	    stopmsg = 1;
 	    zexit(lastval, 0);
 	}
-	zerrnam("zsh", (!islogin) ? "use 'exit' to exit."
-		: "use 'logout' to logout.");
+	/*
+	 * Don't print the message if it was already handled by
+	 * zle, since that makes special arrangements to keep
+	 * the display tidy.
+	 */
+	if (!use_exit_printed)
+	    zerrnam("zsh", (!islogin) ? "use 'exit' to exit."
+		    : "use 'logout' to logout.");
     }
 }