diff --git a/examples/is_tty.rs b/examples/is_tty.rs index 108a134..e6c7d01 100644 --- a/examples/is_tty.rs +++ b/examples/is_tty.rs @@ -1,7 +1,11 @@ -use crossterm::tty::IsTty; -use std::io::stdin; +use crossterm::{tty::IsTty, terminal::{size, SetSize}, execute}; +use std::io::{stdin, stdout}; pub fn main() { + println!("{:?}", size().unwrap()); + execute!(stdout(), SetSize(10, 10)).unwrap(); + println!("{:?}", size().unwrap()); + if stdin().is_tty() { println!("Is TTY"); } else { diff --git a/src/terminal.rs b/src/terminal.rs index c2c1887..b2d4449 100644 --- a/src/terminal.rs +++ b/src/terminal.rs @@ -338,7 +338,7 @@ impl Command for Clear { } } -/// A command that sets the terminal size `(columns, rows)`. +/// A command that sets the terminal buffer size `(columns, rows)`. /// /// # Notes ///