Struct crossterm::terminal::EnterAlternateScreen
source · pub struct EnterAlternateScreen;
Expand description
A command that switches to alternate screen.
Notes
- Commands must be executed/queued for execution otherwise they do nothing.
- Use LeaveAlternateScreen command to leave the entered alternate screen.
Examples
use std::io::{stdout, Write};
use crossterm::{execute, Result, terminal::{EnterAlternateScreen, LeaveAlternateScreen}};
fn main() -> Result<()> {
execute!(stdout(), EnterAlternateScreen)?;
// Do anything on the alternate screen
execute!(stdout(), LeaveAlternateScreen)
}
Trait Implementations§
source§impl Clone for EnterAlternateScreen
impl Clone for EnterAlternateScreen
source§fn clone(&self) -> EnterAlternateScreen
fn clone(&self) -> EnterAlternateScreen
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Command for EnterAlternateScreen
impl Command for EnterAlternateScreen
source§fn write_ansi(&self, f: &mut impl Write) -> Result
fn write_ansi(&self, f: &mut impl Write) -> Result
Write an ANSI representation of this command to the given writer.
An ANSI code can manipulate the terminal by writing it to the terminal buffer.
However, only Windows 10 and UNIX systems support this. Read more
source§fn is_ansi_code_supported(&self) -> bool
fn is_ansi_code_supported(&self) -> bool
Returns whether the ANSI code representation of this command is supported by windows. Read more
source§impl Debug for EnterAlternateScreen
impl Debug for EnterAlternateScreen
source§impl PartialEq<EnterAlternateScreen> for EnterAlternateScreen
impl PartialEq<EnterAlternateScreen> for EnterAlternateScreen
source§fn eq(&self, other: &EnterAlternateScreen) -> bool
fn eq(&self, other: &EnterAlternateScreen) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.