From bb8a2804c118acf795178858f75efc5cb038a647 2014-04-24 22:55:15 From: Paul Ivanov Date: 2014-04-24 22:55:15 Subject: [PATCH] allow keyboard interrupt to break out of ipdb @takluyver @minrk and I discussed this issue in person. It's currently problematic that there is no way, short of restarting a kernel, to get out of an ipdb session if you've deleted the output of the cell in the notebook which started it (by e.g. re-executing that cell). This patch makes Ctrl-C behave the same as Ctrl-D inside of ipdb - it exits the ipdb session. This also makes it possible to stop ipdb sessions from another client. I polled @katyhuff, @scopatz, and some other pyne/pyne hackers and they were surprised to hear that this was not the behavior already. --- diff --git a/IPython/core/debugger.py b/IPython/core/debugger.py index 93f573f..d156a0f 100644 --- a/IPython/core/debugger.py +++ b/IPython/core/debugger.py @@ -278,6 +278,7 @@ class Pdb(OldPdb): OldPdb.interaction(self, frame, traceback) except KeyboardInterrupt: self.shell.write("\nKeyboardInterrupt\n") + break else: break