#term #terminal #size #width #dimension

termize

functions for determining terminal sizes and dimensions

2 releases

0.1.1 Dec 30, 2019
0.1.0 Dec 30, 2019

#140 in Command-line interface

Download history 6180/week @ 2020-12-25 7839/week @ 2021-01-01 7875/week @ 2021-01-08 7952/week @ 2021-01-15 8161/week @ 2021-01-22 7417/week @ 2021-01-29 7296/week @ 2021-02-05 6896/week @ 2021-02-12 8049/week @ 2021-02-19 7902/week @ 2021-02-26 6678/week @ 2021-03-05 8254/week @ 2021-03-12 7891/week @ 2021-03-19 9451/week @ 2021-03-26 8341/week @ 2021-04-02 5930/week @ 2021-04-09

32,285 downloads per month
Used in 31 crates (4 directly)

MIT/Apache

16KB
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

~33KB