delete-terminal-functions is a variable defined in `C source code'.
Its value is
nil
This variable may be risky if used as a file-local variable.
Documentation:
Special hook run when a terminal is deleted.
Each function is called with argument, the terminal.
This may be called just before actually deleting the terminal,
or some time later.