24 releases

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

#32 in Command-line interface

Download history 529781/week @ 2024-08-19 496520/week @ 2024-08-26 498942/week @ 2024-09-02 524154/week @ 2024-09-09 497462/week @ 2024-09-16 550081/week @ 2024-09-23 591431/week @ 2024-09-30 620316/week @ 2024-10-07 595712/week @ 2024-10-14 616341/week @ 2024-10-21 708553/week @ 2024-10-28 786738/week @ 2024-11-04 813496/week @ 2024-11-11 798332/week @ 2024-11-18 658666/week @ 2024-11-25 732934/week @ 2024-12-02

3,041,350 downloads per month
Used in 2,332 crates (271 directly)

MIT/Apache

12KB
168 lines

terminal-size

Documentation

Rust library for 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–11MB
~130K SLoC