mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-11 13:01:28 +02:00
22727: "use 'exit' to exit" was suboptimal
This commit is contained in:
parent
d8ce9807d4
commit
b477e24aa2
3 changed files with 22 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2006-09-17 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||||
|
|
||||||
|
* 22727: Src/init.c, Src/Zle/zle_main.c: "use 'exit' to exit"
|
||||||
|
was suboptimal.
|
||||||
|
|
||||||
2006-09-16 Andrey Borzenkov <bor@zsh.org>
|
2006-09-16 Andrey Borzenkov <bor@zsh.org>
|
||||||
|
|
||||||
* 22721: Makefile.in: add pdf target
|
* 22721: Makefile.in: add pdf target
|
||||||
|
|
|
@ -1232,6 +1232,7 @@ execzlefunc(Thingy func, char **args, int set_bindk)
|
||||||
!zlell && isfirstln && (zlereadflags & ZLRF_IGNOREEOF)) {
|
!zlell && isfirstln && (zlereadflags & ZLRF_IGNOREEOF)) {
|
||||||
showmsg((!islogin) ? "zsh: use 'exit' to exit." :
|
showmsg((!islogin) ? "zsh: use 'exit' to exit." :
|
||||||
"zsh: use 'logout' to logout.");
|
"zsh: use 'logout' to logout.");
|
||||||
|
use_exit_printed = 1;
|
||||||
eofsent = 1;
|
eofsent = 1;
|
||||||
ret = 1;
|
ret = 1;
|
||||||
} else {
|
} else {
|
||||||
|
|
18
Src/init.c
18
Src/init.c
|
@ -1244,6 +1244,13 @@ fallback_compctlread(char *name, UNUSED(char **args), UNUSED(Options ops), UNUSE
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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
|
* This is real main entry point. This has to be mod_export'ed
|
||||||
* so zsh.exe can found it on Cygwin
|
* so zsh.exe can found it on Cygwin
|
||||||
|
@ -1313,6 +1320,7 @@ zsh_main(UNUSED(int argc), char **argv)
|
||||||
init_misc();
|
init_misc();
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
use_exit_printed = 0;
|
||||||
/*
|
/*
|
||||||
* See if we can free up some of jobtab.
|
* See if we can free up some of jobtab.
|
||||||
* We only do this at top level, because if we are
|
* We only do this at top level, because if we are
|
||||||
|
@ -1343,7 +1351,13 @@ zsh_main(UNUSED(int argc), char **argv)
|
||||||
stopmsg = 1;
|
stopmsg = 1;
|
||||||
zexit(lastval, 0);
|
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.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue