crossterm 0.29.0

A crossplatform terminal library for manipulating terminals.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crossterm::{
    execute,
    terminal::{size, SetSize},
    tty::IsTty,
};
use std::io::{stdin, stdout};

pub fn main() {
    println!("size: {:?}", size().unwrap());
    execute!(stdout(), SetSize(10, 10)).unwrap();
    println!("resized: {:?}", size().unwrap());

    if stdin().is_tty() {
        println!("Is TTY");
    } else {
        println!("Is not TTY");
    }
}