Function terminal_size::terminal_size

source ยท
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.