pub fn terminal_size() -> Option<(Width, Height)>
Expand description

Returns the size of the terminal.

This function checks the stdout, stderr, and stdin streams (in that order). The size of the first stream that is a TTY will be returned. If nothing is a TTY, then None is returned.

Examples found in repository?
examples/get_size.rs (line 48)
45
46
47
48
49
50
51
52
fn main() {
    println!(
        "Size from terminal_size():                    {:?}",
        terminal_size::terminal_size()
    );

    run();
}