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
orstty size
and parsing the output. Instead, this uses the ioctl
that these
commands use, TIOCGWINSZ
.
Install
- Maintainers
-
Sources
terminal_size-0.2.0.tbz
sha256=d6b62cd28c4071ac85ca9528088745c124c9094efeae91722514736f9973b0fb
sha512=fd91266b156f52c28338fc8ba5c5c0626b93afa6388fb9e0f98d0f7c200ded02eac56af82b10a3da8d7ec2ef7a91a95fcb113f051a8ec077e155e2ffda75d1c0
Dependencies
Reverse Dependencies
progress
< "0.2.0"