eshell-unload-hook

eshell-unload-hook is a variable defined in `eshell.el'.
Its value is
(eshell-unload-all-modules)

  • This variable may be risky if used as a file-local variable.

Documentation:
A hook run when Eshell is unloaded from memory.

You can customize this variable.