We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 29da763 commit c4fdc9cCopy full SHA for c4fdc9c
src/theme.rs
@@ -839,9 +839,16 @@ impl<'a> TermThemeRenderer<'a> {
839
})
840
}
841
842
+ /// Clear the current theme.
843
+ ///
844
+ /// Position the cursor at the beginning of the current line.
845
pub fn clear(&mut self) -> io::Result<()> {
846
+ // clear the current line first, so the cursor ends at the beginning of the current line.
847
+ self.term.clear_line()?;
848
self.term
849
.clear_last_lines(self.height + self.prompt_height)?;
850
+ // self.term now contains self.height + self.prompt_height empty lines after
851
+ // the current line. That doesn't really matter, as these are empty.
852
self.height = 0;
853
Ok(())
854
0 commit comments