Skip to main content

get_terminal_width

Function get_terminal_width 

Source
pub fn get_terminal_width() -> Option<usize>
Expand description

Get the terminal width.

Returns the terminal width in columns, or None if it cannot be determined.

This implementation checks the COLUMNS environment variable, which is commonly set by shells. For more robust terminal size detection, consider using a crate like terminal_size.