package terminal_size

  1. Overview
  2. Docs
Get the dimensions of the terminal

Install

Dune Dependency

Authors

Maintainers

Sources

terminal_size-0.1.3.tbz
sha256=e3d05e2ec5e175b7fc8f9f96252e613da7bd8be4e07d221894f5d899afc61794
md5=b99f6a769e503dae7c04568100e29214

README.md.html

README.md

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.

OCaml

Innovation. Community. Security.