diff options
Diffstat (limited to 'Src/init.c')
-rw-r--r-- | Src/init.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Src/init.c b/Src/init.c index e9e6be9b4..e7e62e2f7 100644 --- a/Src/init.c +++ b/Src/init.c @@ -94,6 +94,7 @@ mod_export struct hookdef zshhooks[] = { HOOKDEF("exit", NULL, HOOKF_ALL), HOOKDEF("before_trap", NULL, HOOKF_ALL), HOOKDEF("after_trap", NULL, HOOKF_ALL), + HOOKDEF("get_color_attr", NULL, HOOKF_ALL), }; /* keep executing lists until EOF found */ @@ -157,7 +158,7 @@ loop(int toplevel, int justonce) * Handle that now. */ stopmsg = 1; - zexit(exit_pending >> 1, 0); + zexit(exit_val, 0); } if (tok == LEXERR && !lastval) lastval = 1; @@ -215,14 +216,14 @@ loop(int toplevel, int justonce) clearerr(stderr); } if (subsh) /* how'd we get this far in a subshell? */ - exit(lastval); + realexit(); if (((!interact || sourcelevel) && errflag) || retflag) break; if (isset(SINGLECOMMAND) && toplevel) { dont_queue_signals(); if (sigtrapped[SIGEXIT]) dotrap(SIGEXIT); - exit(lastval); + realexit(); } if (justonce) break; @@ -1358,7 +1359,7 @@ init_misc(char *cmd, char *zsh_name) bshin = fdopen(SHIN, "r"); execstring(cmd, 0, 1, "cmdarg"); stopmsg = 1; - zexit(lastval, 0); + zexit((exit_pending || shell_exiting) ? exit_val : lastval, 0); } if (interact && isset(RCS)) |