Sentinel support

Was #452.
LOL. It's weird that I didn't get an exception when terminating the script interactively. Thank you.