diff --git a/IPython/frontend/terminal/interactiveshell.py b/IPython/frontend/terminal/interactiveshell.py index 62b88b6..23cfe71 100644 --- a/IPython/frontend/terminal/interactiveshell.py +++ b/IPython/frontend/terminal/interactiveshell.py @@ -275,6 +275,8 @@ class TerminalInteractiveShell(InteractiveShell): if self.has_readline: self.readline_startup_hook(self.pre_readline) hlen_b4_cell = self.readline.get_current_history_length() + else: + hlen_b4_cell = 0 # exit_now is set by a call to %Exit or %Quit, through the # ask_exit callback.