package terminal_size

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

Install

Dune Dependency

Authors

Maintainers

Sources

terminal_size-0.2.0.tbz
sha256=d6b62cd28c4071ac85ca9528088745c124c9094efeae91722514736f9973b0fb
sha512=fd91266b156f52c28338fc8ba5c5c0626b93afa6388fb9e0f98d0f7c200ded02eac56af82b10a3da8d7ec2ef7a91a95fcb113f051a8ec077e155e2ffda75d1c0

Description

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

Published: 26 Apr 2022

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.08.0"
  2. dune >= "2.0.0"

Dev Dependencies (1)

  1. alcotest with-test

Used by (1)

  1. progress < "0.2.0"

Conflicts

None