No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2017-09-30 17:26:47 -04:00
examples remove rustfmt artifacts 2017-09-30 16:36:49 -04:00
src minor touchups 2017-09-30 16:49:47 -04:00
.gitignore init 2015-06-26 01:14:35 -04:00
.travis.yml only set cols on linux 2017-09-30 17:26:47 -04:00
appveyor.yml clean up some ci debt 2017-08-07 23:58:38 -04:00
Cargo.toml bump atty version 2017-09-30 16:44:23 -04:00
CHANGELOG.md bump atty version 2017-09-30 16:44:23 -04:00
LICENSE update lic [skip ci] 2017-09-30 16:57:13 -04:00
README.md update readme [skip ci] 2017-09-30 16:55:32 -04:00
rustfmt.toml update rustfmt 2017-09-30 16:36:09 -04:00

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