Add option to clear terminal history and current screen content.
This commit is contained in:
parent
24d0f561e8
commit
abe2c57129
@ -239,6 +239,8 @@ impl Command for LeaveAlternateScreen {
|
|||||||
pub enum ClearType {
|
pub enum ClearType {
|
||||||
/// All cells.
|
/// All cells.
|
||||||
All,
|
All,
|
||||||
|
/// All plus history
|
||||||
|
Purge,
|
||||||
/// All cells from the cursor position downwards.
|
/// All cells from the cursor position downwards.
|
||||||
FromCursorDown,
|
FromCursorDown,
|
||||||
/// All cells from the cursor position upwards.
|
/// All cells from the cursor position upwards.
|
||||||
@ -307,6 +309,7 @@ impl Command for Clear {
|
|||||||
fn write_ansi(&self, f: &mut impl fmt::Write) -> fmt::Result {
|
fn write_ansi(&self, f: &mut impl fmt::Write) -> fmt::Result {
|
||||||
f.write_str(match self.0 {
|
f.write_str(match self.0 {
|
||||||
ClearType::All => csi!("2J"),
|
ClearType::All => csi!("2J"),
|
||||||
|
ClearType::Purge => csi!("3J"),
|
||||||
ClearType::FromCursorDown => csi!("J"),
|
ClearType::FromCursorDown => csi!("J"),
|
||||||
ClearType::FromCursorUp => csi!("1J"),
|
ClearType::FromCursorUp => csi!("1J"),
|
||||||
ClearType::CurrentLine => csi!("2K"),
|
ClearType::CurrentLine => csi!("2K"),
|
||||||
|
Loading…
Reference in New Issue
Block a user