7 releases

Uses old Rust 2015

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

#152 in Command-line interface

Download history 1407/week @ 2023-11-20 1864/week @ 2023-11-27 1293/week @ 2023-12-04 2783/week @ 2023-12-11 2247/week @ 2023-12-18 926/week @ 2023-12-25 1218/week @ 2024-01-01 2058/week @ 2024-01-08 2289/week @ 2024-01-15 1472/week @ 2024-01-22 1619/week @ 2024-01-29 2571/week @ 2024-02-05 1748/week @ 2024-02-12 1843/week @ 2024-02-19 1661/week @ 2024-02-26 2010/week @ 2024-03-04

7,498 downloads per month
Used in 53 crates (28 directly)

MIT license

8KB
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

~8–285KB