Skip to content
Browse files

%reset doesn't reset prompt number.

  • Loading branch information...
1 parent 06bd028 commit 36918eb4a4b519976e2ba1ed22477f2e4ee6155a @takluyver committed
Showing with 8 additions and 8 deletions.
  1. +4 −4 IPython/core/history.py
  2. +3 −3 IPython/core/interactiveshell.py
  3. +1 −1 IPython/core/magic.py
View
8 IPython/core/history.py
@@ -164,15 +164,15 @@ def name_session(self, name):
def reset(self, new_session=True):
"""Clear the session history, releasing all object references, and
optionally open a new session."""
- if self.session_number:
- self.end_session()
- self.input_hist_parsed[:] = [""]
- self.input_hist_raw[:] = [""]
self.output_hist.clear()
# The directory history can't be completely empty
self.dir_hist[:] = [os.getcwd()]
if new_session:
+ if self.session_number:
+ self.end_session()
+ self.input_hist_parsed[:] = [""]
+ self.input_hist_raw[:] = [""]
self.new_session()
## -------------------------------
View
6 IPython/core/interactiveshell.py
@@ -1045,12 +1045,12 @@ def reset(self, new_session=True):
"""
# Clear histories
self.history_manager.reset(new_session)
+ # Reset counter used to index all histories
+ if new_session:
+ self.execution_count = 1
# Flush cached output items
self.displayhook.flush()
-
- # Reset counter used to index all histories
- self.execution_count = 0
# Restore the user namespaces to minimal usability
for ns in self.ns_refs_table:
View
2 IPython/core/magic.py
@@ -1007,7 +1007,7 @@ def magic_reset(self, parameter_s=''):
del(user_ns[i])
else: # Hard reset
- self.shell.reset(new_session = True)
+ self.shell.reset(new_session = False)

0 comments on commit 36918eb

Please sign in to comment.
Something went wrong with that request. Please try again.