package notty
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=00c77c02497cb8c9eeba338d75f4b11c471253467e8742ead1e7fc1afaabae71
md5=f85f6d0099483230b2b60335ab4496d1
doc/notty.unix/Notty_unix/Term/Winch/index.html
Module Term.Winch
Manual SIGWINCH
handling.
Unix delivers notifications about tty size changes through the SIGWINCH
signal. A handler for this signal is installed as soon as a new terminal is created. Replacing the global SIGWINCH
handler using the Sys
module will cause this module to malfunction, as the size change notifications will no longer be delivered.
You might still want to ignore resizes reported by event
and directly listen to SIGWINCH
. This module allows installing such listeners without conflicting with the rest of the machinery.
val add : Unix.file_descr -> ((int * int) -> unit) -> remove
add fd f
registers a SIGWINCH
handler. Every time the signal is delivered, f
is called with the current size of the tty backing fd
. If fd
is not a tty, f
is never called.
Handlers are called in the order of their registration.
val remove : remove -> unit
remove r
removes the handler associated with r
. Does nothing if the handler has already been removed.