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 334902/week @ 2024-01-03 359382/week @ 2024-01-10 432993/week @ 2024-01-17 408382/week @ 2024-01-24 438831/week @ 2024-01-31 437920/week @ 2024-02-07 430507/week @ 2024-02-14 448348/week @ 2024-02-21 489037/week @ 2024-02-28 437569/week @ 2024-03-06 429815/week @ 2024-03-13 444182/week @ 2024-03-20 413994/week @ 2024-03-27 421352/week @ 2024-04-03 423506/week @ 2024-04-10 341827/week @ 2024-04-17

1,680,811 downloads per month
Used in 1,935 crates (234 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

~1–12MB
~130K SLoC