.z.exit:f
Where f is a unary function, f is called with the exit parameter as the argument just
before exiting the kdb+ session.
The exit parameter is the argument to the exit function, or 0 if manual exit with
\\ quit
The handler cannot cancel the exit.
.z.exit can be unset with \x .z.exit, which restores the default behavior.
The default behavior is equivalent to setting .z.exit to {}, i.e. do nothing.
q).z.exit
'.z.exit
q).z.exit:{0N!x}
q)\\
0
os>..
q).z.exit:{0N!x}
q)exit 42
42
os>..
q).z.exit:{0N!x}
q)exit 0
0