Hook function before the main shell is about to exit
Hook function zshexit
is called right before the main shell is about to exit normally.
It’s not called when functions exit or when subshells exit.
Links
BashSupport Pro is a Zsh IDE with support for zshexit – try it now!