7 releases

0.1.6 Apr 28, 2019
0.1.5 Oct 1, 2017
0.1.4 Dec 7, 2016
0.1.1 Dec 14, 2015
0.1.0 Nov 15, 2015

#134 in Command-line interface

Download history 101/week @ 2019-12-02 179/week @ 2019-12-09 237/week @ 2019-12-16 332/week @ 2019-12-23 1079/week @ 2019-12-30 232/week @ 2020-01-06 67/week @ 2020-01-13 186/week @ 2020-01-20 861/week @ 2020-01-27 1180/week @ 2020-02-03 225/week @ 2020-02-10 121/week @ 2020-02-17 293/week @ 2020-02-24 140/week @ 2020-03-02 435/week @ 2020-03-09 134/week @ 2020-03-16

489 downloads per month

MIT license

7KB
142 lines

termsize

Build Status Build status Coverage Status

because terminal size matters

Termsize is a rust crate providing a multi-platform interface for resolving your terminal's current size in rows and columns. On most unix systems, this is similar invoking the stty(1) program, requesting the terminal size.

Documentation

install

add the following to your Cargo.toml file

[dependencies]
termsize = "0.1"

usage

Termize provides one function, get, which returns a termsize::Size struct exposing two fields: rows and cols representing the number of rows and columns a a terminal's stdout supports.

extern crate termsize;

pub fn main() {
  termsize::get().map(|size| {
    println!("rows {} cols {}", size.rows, size.cols)
  });
}

Doug Tangren (softprops) 2015-2017

Dependencies

~64KB