Skip to content

Commit

Permalink
Renderer.clear improved.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanslenders committed Sep 29, 2014
1 parent a7517c9 commit efca3ea
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions prompt_toolkit/renderer.py
Expand Up @@ -573,10 +573,12 @@ def clear(self):
"""
Clear screen and go to 0,0
"""
# Erase current output first.
self.erase()

# Send "Erase Screen" command and go to (0, 0).
self._stdout.write(TerminalCodes.ERASE_SCREEN)
self._stdout.write(TerminalCodes.RESET_ATTRIBUTES)
self._stdout.write(TerminalCodes.CURSOR_GOTO(0, 0))
self._stdout.flush()

self.reset()
self.request_absolute_cursor_position()

0 comments on commit efca3ea

Please sign in to comment.