22 releases

0.3.0 Sep 15, 2023
0.2.6 Apr 3, 2023
0.2.5 Feb 14, 2023
0.2.3 Nov 29, 2022
0.1.1 Aug 27, 2015

#30 in Command-line interface

Download history 329007/week @ 2023-12-12 266123/week @ 2023-12-19 194793/week @ 2023-12-26 322442/week @ 2024-01-02 352244/week @ 2024-01-09 429543/week @ 2024-01-16 407779/week @ 2024-01-23 432829/week @ 2024-01-30 441797/week @ 2024-02-06 427998/week @ 2024-02-13 449604/week @ 2024-02-20 481774/week @ 2024-02-27 446714/week @ 2024-03-05 432052/week @ 2024-03-12 438185/week @ 2024-03-19 346267/week @ 2024-03-26

1,748,058 downloads per month
Used in 1,876 crates (230 directly)

MIT/Apache

11KB
158 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.63.0 (2022-08-11)

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

~2–13MB
~151K SLoC