##// END OF EJS Templates
%reset doesn't reset prompt number.
Thomas Kluyver -
Show More
@@ -164,15 +164,15 b' class HistoryManager(Configurable):'
164 def reset(self, new_session=True):
164 def reset(self, new_session=True):
165 """Clear the session history, releasing all object references, and
165 """Clear the session history, releasing all object references, and
166 optionally open a new session."""
166 optionally open a new session."""
167 if self.session_number:
168 self.end_session()
169 self.input_hist_parsed[:] = [""]
170 self.input_hist_raw[:] = [""]
171 self.output_hist.clear()
167 self.output_hist.clear()
172 # The directory history can't be completely empty
168 # The directory history can't be completely empty
173 self.dir_hist[:] = [os.getcwd()]
169 self.dir_hist[:] = [os.getcwd()]
174
170
175 if new_session:
171 if new_session:
172 if self.session_number:
173 self.end_session()
174 self.input_hist_parsed[:] = [""]
175 self.input_hist_raw[:] = [""]
176 self.new_session()
176 self.new_session()
177
177
178 ## -------------------------------
178 ## -------------------------------
@@ -1045,12 +1045,12 b' class InteractiveShell(Configurable, Magic):'
1045 """
1045 """
1046 # Clear histories
1046 # Clear histories
1047 self.history_manager.reset(new_session)
1047 self.history_manager.reset(new_session)
1048 # Reset counter used to index all histories
1049 if new_session:
1050 self.execution_count = 1
1048
1051
1049 # Flush cached output items
1052 # Flush cached output items
1050 self.displayhook.flush()
1053 self.displayhook.flush()
1051
1052 # Reset counter used to index all histories
1053 self.execution_count = 0
1054
1054
1055 # Restore the user namespaces to minimal usability
1055 # Restore the user namespaces to minimal usability
1056 for ns in self.ns_refs_table:
1056 for ns in self.ns_refs_table:
@@ -1007,7 +1007,7 b' Currently the magic system has the following functions:\\n"""'
1007 del(user_ns[i])
1007 del(user_ns[i])
1008
1008
1009 else: # Hard reset
1009 else: # Hard reset
1010 self.shell.reset(new_session = True)
1010 self.shell.reset(new_session = False)
1011
1011
1012
1012
1013
1013
General Comments 0
You need to be logged in to leave comments. Login now