14 releases

0.1.16 Jan 19, 2021
0.1.15 Nov 13, 2020
0.1.13 Jul 3, 2020
0.1.11 Mar 27, 2020
0.1.1 Aug 27, 2015

#15 in Command-line interface

Download history 31253/week @ 2020-12-25 47719/week @ 2021-01-01 52905/week @ 2021-01-08 48857/week @ 2021-01-15 62396/week @ 2021-01-22 69918/week @ 2021-01-29 68631/week @ 2021-02-05 74733/week @ 2021-02-12 74855/week @ 2021-02-19 81280/week @ 2021-02-26 85474/week @ 2021-03-05 88460/week @ 2021-03-12 78334/week @ 2021-03-19 84293/week @ 2021-03-26 84296/week @ 2021-04-02 75130/week @ 2021-04-09

248,530 downloads per month
Used in 814 crates (74 directly)

MIT/Apache

9KB
116 lines

terminal-size

Documention

Rust library to getting the size of your terminal.

Works on Linux, MacOS, and Windows.

use terminal_size::{Width, Height, terminal_size};

let size = terminal_size();
if let Some((Width(w), Height(h))) = size {
    println!("Your terminal is {} cols wide and {} lines tall", w, h);
} else {
    println!("Unable to get terminal size");
}

Minimum Rust Version

This crate requires a minimum rust version of 1.31.0 (2018-12-06)

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~33KB