From 7929d97254f84932ab79baf613f3f300ca0a5f84 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 9 Nov 2006 11:04:10 +0000 Subject: 22984: add zshexit hook --- ChangeLog | 3 +++ Doc/Zsh/func.yo | 8 ++++++++ Src/builtin.c | 1 + 3 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 09849a726..d7f38744b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2006-11-09 Peter Stephenson + * 22984: Doc/Zsh/func.yo, Src/builtin.c: add zshexit hook + to 22978. + * 22988: arno: Completion/Unix/Command/_make: failed on special variable names, so use local -h. Probably not a complete fix since the function can run recursivesly for diff --git a/Doc/Zsh/func.yo b/Doc/Zsh/func.yo index 5fac56aac..74d031fd1 100644 --- a/Doc/Zsh/func.yo +++ b/Doc/Zsh/func.yo @@ -203,6 +203,14 @@ size-limited version of the command (with things like function bodies elided); the third argument contains the full text that is being executed. ) +findex(zshexit) +vindex(zshexit_functions) +item(tt(zshexit))( +Executed at the point where the main shell is about to exit normally. +This is not called by exiting subshells, nor when the tt(exec) +precommand modifier is used before an external command. Also, unlike +tt(TRAPEXIT), it is not called when functions exit. +) item(tt(TRAP)var(NAL))( cindex(signals, trapping) cindex(trapping signals) diff --git a/Src/builtin.c b/Src/builtin.c index ff40c8b70..70de5bcec 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -4436,6 +4436,7 @@ zexit(int val, int from_where) } if (sigtrapped[SIGEXIT]) dotrap(SIGEXIT); + callhookfunc("zshexit", NULL, 1); runhookdef(EXITHOOK, NULL); if (opts[MONITOR] && interact && (SHTTY != -1)) { release_pgrp(); -- cgit 1.4.1