Skip to content

Commit

Permalink
%reset doesn't reset prompt number.
Browse files Browse the repository at this point in the history
  • Loading branch information
takluyver authored and fperez committed Apr 10, 2011
1 parent a6a440b commit b24bd65
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions IPython/core/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

## -------------------------------
Expand Down
6 changes: 3 additions & 3 deletions IPython/core/interactiveshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion IPython/core/magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)



Expand Down

0 comments on commit b24bd65

Please sign in to comment.