pub fn dimensions_stdin() -> Option<(usize, usize)> {
    let w = unsafe { get_dimensions_in() };

    if w.ws_col == 0 || w.ws_row == 0 {
        None
    } else {
        Some((w.ws_col as usize, w.ws_row as usize))
    }
}
/// Query the current processes's input (`stdin`) *only*, in the attempt to determine
/// terminal width. If that stream is actually a tty, this function returns its width
/// and height as a number of characters.
///
/// # Errors
/// 
/// If the stream is not a tty or return any errors this function will return `None`.
/// 
/// # Example
/// 
/// To get the dimensions of your terminal window, simply use the following:
/// 
/// ```no_run
/// # use term_size;
/// if let Some((w, h)) = term_size::dimensions_stdin() {
///     println!("Width: {}\nHeight: {}", w, h);
/// } else {
///     println!("Unable to get term size :(")
/// }
/// ```
Query the current processes's input (`stdin`) *only*, in the attempt to determine
terminal width. If that stream is actually a tty, this function returns its width
and height as a number of characters.
Query the current processes ' s input ( ` stdin ` ) * only * in the attempt to determine terminal width . If that stream is actually a tty this function returns its width and height as a number of characters .
pub fn dimensions_stdin() -> Option<(usize, usize)> {
    let w = unsafe { get_dimensions_in() };
    if w.ws_col == 0 || w.ws_row == 0 {
        None
    } else {
        Some((w.ws_col as usize, w.ws_row as usize))
    }
}
pub fn dimensions_stdin ( ) -> Option < ( usize , usize ) > { let w = unsafe { get_dimensions_in ( ) } ; if w . ws_col == 0 || w . ws_row == 0 { None } else { Some ( ( w . ws_col as usize , w . ws_row as usize ) ) } }
Query the current processes's input (`stdin`) *only*, in the attempt to determine
terminal width.
Query the current processes ' s input ( ` stdin ` ) * only * in the attempt to determine terminal width .
errors
If the stream is not a tty or return any errors this function will return `None`.
If the stream is not a tty or return any errors this function will return ` None ` .
example
To get the dimensions of your terminal window, simply use the following.


To get the dimensions of your terminal window simply use the following .
use term_size;
if let Some((w, h)) = term_size::dimensions_stdin() {
println!("Width: {}\nHeight: {}", w, h);
} else {
println!("Unable to get term size :(")
}
```
if let Some (( w h )) = term_size :: dimensions_stdin () { println! ( " Width : {} \ nHeight : {} " w h ) ; } else { println! ( " Unable to get term size : ( " ) } ` ` `