From 3c0257dae583834063c2f36c2ba3e57156e3c4f0 2011-10-23 14:54:12 From: Julian Taylor Date: 2011-10-23 14:54:12 Subject: [PATCH] don't save empty lines in history --- diff --git a/IPython/frontend/terminal/interactiveshell.py b/IPython/frontend/terminal/interactiveshell.py index f257223..5f8d483 100644 --- a/IPython/frontend/terminal/interactiveshell.py +++ b/IPython/frontend/terminal/interactiveshell.py @@ -231,7 +231,7 @@ class TerminalInteractiveShell(InteractiveShell): def _replace_rlhist_multiline(self, source_raw): """Store multiple lines as a single entry in history""" - if self.multiline_history and self.has_readline: + if self.multiline_history and self.has_readline and source_raw.rstrip(): hlen = self.readline.get_current_history_length() for i in range(hlen - self.hlen_before_cell): self.readline.remove_history_item(hlen - i - 1)