about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2004-09-21 14:07:41 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2004-09-21 14:07:41 +0000
commit0f1267a8aaa079a10b241acfb8eb82e52867ade2 (patch)
tree9c4a75b0f5c924ff8b95248606ce22a77cc63dee /Src
parentc16cbae6526aa051e4133169a4a306293ea93129 (diff)
downloadzsh-0f1267a8aaa079a10b241acfb8eb82e52867ade2.tar.gz
zsh-0f1267a8aaa079a10b241acfb8eb82e52867ade2.tar.xz
zsh-0f1267a8aaa079a10b241acfb8eb82e52867ade2.zip
20398: allow clean exit from within widget function
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/zle_main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index dbe34a761..48511e017 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -680,7 +680,13 @@ zlecore(void)
     FD_ZERO(&foofd);
 #endif
 
-    while (!done && !errflag) {
+    /*
+     * A widget function may decide to exit the shell.
+     * We never exit directly from functions, to allow
+     * the shell to tidy up, so we have to test for
+     * that explicitly.
+     */
+    while (!done && !errflag && !exit_pending) {
 
 	statusline = NULL;
 	vilinerange = 0;