Permalink
Browse files

bring multiline-hist fix from trunk into zmq console

  • Loading branch information...
1 parent fb33b1b commit dbb4de68b86694a3a56efb5cbee9cb9e826cf54c @minrk minrk committed Nov 7, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 IPython/frontend/terminal/console/interactiveshell.py
@@ -227,6 +227,9 @@ def interact(self, display_banner=None):
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.
@@ -271,7 +274,8 @@ def interact(self, display_banner=None):
#double-guard against keyboardinterrupts during kbdint handling
try:
self.write('\nKeyboardInterrupt\n')
- self.input_splitter.reset()
+ source_raw = self.input_splitter.source_raw_reset()[1]
+ hlen_b4_cell = self._replace_rlhist_multiline(source_raw, hlen_b4_cell)
more = False
except KeyboardInterrupt:
pass
@@ -299,6 +303,7 @@ def interact(self, display_banner=None):
self.edit_syntax_error()
if not more:
source_raw = self.input_splitter.source_reset()
+ hlen_b4_cell = self._replace_rlhist_multiline(source_raw, hlen_b4_cell)
self.run_cell(source_raw)

0 comments on commit dbb4de6

Please sign in to comment.