We all know Control-C traps the debugger. Sometimes you want an application to exit on Control-C instead of starting the debugger. You can do that using on_signal/3, as also used by library(main) for main/0.
I’ve noticed that
ctest for running the test suite, when interrupted, leaves a lot of Prolog processes behind. That is because
ctest seems to pass on the interrupt but doesn’t wait for the child. I think that is a bug of
ctest (raised), but still this is probably not what we want.
The question is, when should we disable interrupt handling? There is a command line option
--debug[=bool], which currently suppresses debug info and which we could also use to disable handling interrupts as why would you want to debug if you have suppressed debug info?. There is
--signals=[bool], but that does too much as it also party inhibits asynchronous thread communication.
- We could add one more flag, or is is
- We could disable by default if not all I/O streams connect to a terminal (as is also done for disabling color output)?
- Other ideas/common practice?