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

#31 in Command-line interface

Download history 414057/week @ 2024-01-26 449331/week @ 2024-02-02 427872/week @ 2024-02-09 437715/week @ 2024-02-16 463850/week @ 2024-02-23 478484/week @ 2024-03-01 428647/week @ 2024-03-08 430170/week @ 2024-03-15 442123/week @ 2024-03-22 424821/week @ 2024-03-29 406640/week @ 2024-04-05 420685/week @ 2024-04-12 421575/week @ 2024-04-19 425806/week @ 2024-04-26 423390/week @ 2024-05-03 355392/week @ 2024-05-10

1,695,290 downloads per month
Used in 1,961 crates (236 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–14MB
~150K SLoC