From 51ca6ff8b21d12814528e4725a984c1179407c30 2015-12-05 14:10:34 From: Matthias Bussonnier Date: 2015-12-05 14:10:34 Subject: [PATCH] Catch keyboard interrupt and quit --- diff --git a/IPython/core/application.py b/IPython/core/application.py index 78459ea..bf2ab7e 100644 --- a/IPython/core/application.py +++ b/IPython/core/application.py @@ -201,8 +201,11 @@ class BaseIPythonApplication(Application): self.log.warning("Subcommand `ipython {sub}` is deprecated and will be removed " "in future versions.".format(sub=subc)) self.log.warning("You likely want to use `jupyter {sub}`... continue " - "in 5 sec".format(sub=subc)) - time.sleep(5) + "in 5 sec. Press Ctrl-C to quit now.".format(sub=subc)) + try: + time.sleep(5) + except KeyboardInterrupt: + sys.exit(1) return super(BaseIPythonApplication, self).initialize_subcommand(subc, argv) def init_crash_handler(self):