Wx import sets the SIGINT handler to 0 so we reset it to python's
default_int_handler to handle Ctrl+C.
The following thread discusses the issue:
BUG: Ctrl+C crashes wx pylab kernel in qtconsole.
@ellisonbg, @fperez, @epatters -- this fixes a pretty serious bug with the qtconsole: try this:
Create an infinite loop and hit Ctrl-C and the prompt is lost. It would be great if this were merged ASAP, on the mac Mayavi only works on wxPython so this can be bad for someone wanting that.
I know very little about the event loop integration, but does the same fix need to be in the 'inputhook' system for integration with plain terminal IPython? If someone could check if the same bug affects that, that would be great.
I think this is the relevant file: https://github.com/ipython/ipython/blob/master/IPython/lib/inputhookwx.py
Yes, the inputhook already sets the signal handler correctly and in fact that was where this solution was copied over from. :) So this problem does not occur on the terminal client but only on the qtconsole.
Oh yes, I see that code now. No other objections.
Looks good to me too; @jdmarch merge away!