Crate termsize [] [src]

[]

This crate provides a single function, termsize(), which returns the size of the terminal in columns and rows.

Usage

extern crate termsize;
use termsize::termsize;

fn main() {
    match termsize() {
        Some((columns, rows)) => println!("Size of terminal is {} x {}", columns, rows),
        None => println!("Not called from a terminal")
    }
}

Functions

termsize

Returns the size of the terminal as a tuple Option<(width, height)>.