3 unstable releases

Uses new Rust 2024

0.2.0 Jun 22, 2025
0.1.1 Dec 30, 2019
0.1.0 Dec 30, 2019

#88 in Command-line interface

Download history 12133/week @ 2025-03-22 13748/week @ 2025-03-29 12303/week @ 2025-04-05 12625/week @ 2025-04-12 12967/week @ 2025-04-19 12534/week @ 2025-04-26 12188/week @ 2025-05-03 10700/week @ 2025-05-10 12357/week @ 2025-05-17 12958/week @ 2025-05-24 13086/week @ 2025-05-31 16057/week @ 2025-06-07 15397/week @ 2025-06-14 18229/week @ 2025-06-21 16847/week @ 2025-06-28 22733/week @ 2025-07-05

75,770 downloads per month
Used in 30 crates (6 directly)

MIT/Apache

17KB
206 lines

termize

Crates.io Crates.io license license Actions

A Rust library to enable getting terminal sizes and dimensions.

This is a fork repository, original is here.

MSRV (Minimum Supported Rust Version): 1.85.0

Documentation

Usage

First, add the following to your Cargo.toml:

[dependencies]
termize = "0.1"

To get the dimensions of your terminal window, simply use the following:

fn main() {
    if let Some((w, h)) = termize::dimensions() {
        println!("Width: {}\nHeight: {}", w, h);
    } else {
        println!("Unable to get term size :(");
    }
}

License

Copyright Benjamin Sago, Kevin Knapp, Yuki Okushi, and term_size/termize contributors.

Licensed under either of

at your option. 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.

Contributing

Contributions are welcome! Here is our CONTRIBUTING GUIDE.

Dependencies

~0–13MB
~84K SLoC