2 releases

0.1.1 Dec 30, 2019
0.1.0 Dec 30, 2019

#308 in Command-line interface

Download history 15218/week @ 2024-10-01 17359/week @ 2024-10-08 15182/week @ 2024-10-15 17678/week @ 2024-10-22 18116/week @ 2024-10-29 17694/week @ 2024-11-05 19091/week @ 2024-11-12 19373/week @ 2024-11-19 20096/week @ 2024-11-26 20833/week @ 2024-12-03 21251/week @ 2024-12-10 20285/week @ 2024-12-17 16737/week @ 2024-12-24 18627/week @ 2024-12-31 20076/week @ 2025-01-07 16650/week @ 2025-01-14

74,553 downloads per month
Used in 33 crates (8 directly)

MIT/Apache

17KB
206 lines

termize

Crates.io Crates.io license license Actions Cirrus CI

A Rust library to enable getting terminal sizes and dimensions

This is a fork repository, original is here.

MSRV (Minimum Supported Rust Version): 1.31.1

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

~215KB