Skip to content
Snippets Groups Projects
Commit 62940e52 authored by Ticki's avatar Ticki
Browse files

Add clear_before, clear_after and clear_until_newline

parent a6d364e6
No related branches found
No related tags found
No related merge requests found
......@@ -16,10 +16,22 @@ pub trait TermControl {
fn clear(&mut self) -> IoResult<usize> {
self.csi(b"2J")
}
/// Clear everything _after_ the cursor.
fn clear_after(&mut self) -> IoResult<usize> {
self.csi(b"J")
}
/// Clear everything _before_ the cursor.
fn clear_before(&mut self) -> IoResult<usize> {
self.csi(b"1J")
}
/// Clear the current line.
fn clear_line(&mut self) -> IoResult<usize> {
self.csi(b"2K")
}
/// Clear from the cursor until newline.
fn clear_until_newline(&mut self) -> IoResult<usize> {
self.csi(b"K")
}
/// Show the cursor.
fn show_cursor(&mut self) -> IoResult<usize> {
self.csi(b"?25h")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment