15 releases

0.1.17 May 14, 2021
0.1.16 Jan 19, 2021
0.1.15 Nov 13, 2020
0.1.13 Jul 3, 2020
0.1.1 Aug 27, 2015

#18 in Command-line interface

Download history 88362/week @ 2021-04-07 84466/week @ 2021-04-14 81733/week @ 2021-04-21 91798/week @ 2021-04-28 91213/week @ 2021-05-05 98426/week @ 2021-05-12 92567/week @ 2021-05-19 102641/week @ 2021-05-26 94933/week @ 2021-06-02 106646/week @ 2021-06-09 111566/week @ 2021-06-16 103010/week @ 2021-06-23 106278/week @ 2021-06-30 115549/week @ 2021-07-07 113862/week @ 2021-07-14 86779/week @ 2021-07-21

363,774 downloads per month
Used in 973 crates (86 directly)

MIT/Apache

10KB
143 lines

terminal-size

Documention

Rust library to getting the size of your terminal.

Works on Linux, MacOS, Windows, and illumos.

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

~34KB