New comment by tornaria on void-packages repository https://github.com/void-linux/void-packages/pull/35730#issuecomment-1053793760 Comment: > 1. Your original patch to change to change the default SIGINT handling behavior from `True` to `False`, effectively restoring prior behavior and leaving any custom handlers untouched; or Let's do this, I've force-pushed my original patch. This is completely acceptable for sagemath. > Option 1 may cause IPython to crash when it receives SIGINT, but that is functionally no worse than a revert to a prior version of `prompt_toolkit` and I can live with it. I can live with this too. I hadn't even noticed this before I looked at the xonsh bug report. > [...] >having `prompt_toolkit` take special branches in every iteration of the event loop on the off chance that an arbitrary package is installed does not seem to be the right approach and certainly doesn't cover these alternatives. Just for the record, assuming I understand the way python imports work, my patch doesn't add branches in the event loop. It tries to import cysignals.pysignals ONCE when prompt_toolkit is imported for the first time. If that fails, it will import instead alternative pure python functions (not using cysignals / not preserving the os-level sigint handler). These functions are unconditionally called once when prompt starts (to save the sigint handler) and once when the prompt finishes (to restore the sigint handler). The event loop runs all the prompt editing, completion, etc, etc, but this will not mess with signals at all. > If you do PR your optional approach upstream, you should probably define a package option to declare the dependency so that the package can advertise the possibility. I'll wait for comments first before doing a PR. I might ask you for help then, since my understanding of python packaging and hard vs optional dependencies is almost nil.