Skip to content

Commit

Permalink
Clarify that SetSize resizes the terminal buffer.
Browse files Browse the repository at this point in the history
  • Loading branch information
TimonPost committed Jun 30, 2022
1 parent 2115571 commit 6456856
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions examples/is_tty.rs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/terminal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand Down

0 comments on commit 6456856

Please sign in to comment.