11 releases

0.1.13 Jul 3, 2020
0.1.11 Mar 27, 2020
0.1.8 Aug 6, 2018
0.1.7 Jun 16, 2017
0.1.1 Aug 27, 2015

#17 in Command-line interface

Download history 27296/week @ 2020-07-07 29960/week @ 2020-07-14 27236/week @ 2020-07-21 32021/week @ 2020-07-28 28406/week @ 2020-08-04 29591/week @ 2020-08-11 31055/week @ 2020-08-18 29661/week @ 2020-08-25 31980/week @ 2020-09-01 35207/week @ 2020-09-08 32524/week @ 2020-09-15 35019/week @ 2020-09-22 42280/week @ 2020-09-29 42024/week @ 2020-10-06 38079/week @ 2020-10-13 34350/week @ 2020-10-20

130,215 downloads per month
Used in 591 crates (60 directly)

MIT/Apache

9KB
109 lines

terminal-size

Documention

Rust library to getting the size of your terminal.

Works on Linux and Windows, but needs testing on other platforms

Tested on Rust Stable (1.8), Beta (1.9), and Nightly (1.10)

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