7 releases

0.1.8 Aug 6, 2018
0.1.7 Jun 16, 2017
0.1.6 Nov 16, 2016
0.1.5 Apr 23, 2016
0.1.1 Aug 27, 2015

#25 in Command-line interface

Download history 612/week @ 2018-11-14 522/week @ 2018-11-21 778/week @ 2018-11-28 918/week @ 2018-12-05 799/week @ 2018-12-12 713/week @ 2018-12-19 506/week @ 2018-12-26 649/week @ 2019-01-02 662/week @ 2019-01-09 643/week @ 2019-01-16 545/week @ 2019-01-23 205/week @ 2019-01-30 212/week @ 2019-02-06 183/week @ 2019-02-13 222/week @ 2019-02-20

2,682 downloads per month
Used in 20 crates (17 directly)

MIT/Apache

8KB
96 lines

terminal-size

Documention

Rust library to getting the size of your terminal.

Works on Linux and Windows, but needs testing on other platforms

Tested on Rust Stable (1.8), Beta (1.9), and Nightly (1.10)

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");
}

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

~716KB

  • windows winapi 0.3+winnt+processenv+wincon+winbase
  • libc 0.2