diff --git a/jupyter_console/ptshell.py b/jupyter_console/ptshell.py index e5a62471..03165fa9 100644 --- a/jupyter_console/ptshell.py +++ b/jupyter_console/ptshell.py @@ -486,7 +486,7 @@ def interact(self, display_banner=None): self.run_cell(code, store_history=True) def mainloop(self): - self.keepkernel = False + self.keepkernel = not self.own_kernel # An extra layer of protection in case someone mashing Ctrl-C breaks # out of our internal code. while True: