terminal_size

Get the dimensions of the terminal
README

Terminal_size

What is it?

You can use this small ocaml library to detect the dimensions of the terminal
window attached to a process. It contains the two following functions:

val get_rows : unit -> int option
val get_columns : unit -> int option

How does it work?

Usually, to get this information, one would open a pipe from tput cols or
stty size and parsing the output. Instead, this uses the ioctl that these
commands use, TIOCGWINSZ.

Install
Published
05 Jul 2019
Sources
terminal_size-v0.1.4.tbz
sha256=fdca1fee7d872c4a8e5ab003d9915b6782b272e2a3661ca877f2d78dd25371a7
sha512=595e123d5496c2a7de306bf89d0c5ce0d99ea233da87c94c18fb8c366375029c6bbbbaae93e42cc50fd90a35a2501eb2c6a0ddbbc508836d0a0b11bcebe76881
Dependencies
ocaml
>= "4.02.0"
dune
>= "1.10.0"
alcotest
with-test
Reverse Dependencies
progress
< "0.2.0"