package terminal_size

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

Install

Dune Dependency

Authors

Maintainers

Sources

terminal_size-v0.1.4.tbz
sha256=fdca1fee7d872c4a8e5ab003d9915b6782b272e2a3661ca877f2d78dd25371a7
sha512=595e123d5496c2a7de306bf89d0c5ce0d99ea233da87c94c18fb8c366375029c6bbbbaae93e42cc50fd90a35a2501eb2c6a0ddbbc508836d0a0b11bcebe76881

Description

You can use this small library to detect the dimensions of the terminal window attached to a process.

Published: 05 Jul 2019

README

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.

Dependencies (2)

  1. ocaml >= "4.02.0"
  2. dune >= "1.10.0"

Dev Dependencies (1)

  1. alcotest with-test

Used by (1)

  1. progress < "0.2.0"

Conflicts

None

OCaml

Innovation. Community. Security.