term_size
All functions return Error(Nil)
if the terminal’s size could not be
determined for any reason.
Functions
pub fn get() -> Result(#(Int, Int), Nil)
Get the current terminal’s size. The return tuple is of the form
#(rows, columns)
.
import term_size
pub fn main() {
case term_size.get() {
Ok(#(rows, columns)) -> // ...
Error(Nil) -> // ...
}
}