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: |
General Comments 0
You need to be logged in to leave comments.
Login now