Implement Terminal.app's "close if the shell exited cleanly" option
By chris.sn... on November 20, 2011 10:25 (imported from Google Code)
Terminal.app has a preference option to close only if the process exited cleanly. This allows for sessions to be dismissed with ctrl-d as normal, but keeps critical debugging info in place in the event that the shell (or whatever other custom command you're running) crashes, is killed externally, or otherwise exits with a non-zero return code.
While it is true that one can still debug bash segfaults and the like safely with a custom profile, using such a setting obviates the need for separate profiles for normal operation and debugging, and protects against unexpected crashes that nonetheless may require debugging.