diff --git a/src/control.rs b/src/control.rs index 9b35fc0..d8a6724 100644 --- a/src/control.rs +++ b/src/control.rs @@ -16,10 +16,22 @@ pub trait TermControl { fn clear(&mut self) -> IoResult { self.csi(b"2J") } + /// Clear everything _after_ the cursor. + fn clear_after(&mut self) -> IoResult { + self.csi(b"J") + } + /// Clear everything _before_ the cursor. + fn clear_before(&mut self) -> IoResult { + self.csi(b"1J") + } /// Clear the current line. fn clear_line(&mut self) -> IoResult { self.csi(b"2K") } + /// Clear from the cursor until newline. + fn clear_until_newline(&mut self) -> IoResult { + self.csi(b"K") + } /// Show the cursor. fn show_cursor(&mut self) -> IoResult { self.csi(b"?25h")