package notty

  1. Overview
  2. Docs
Declaring terminals

Install

Dune Dependency

Authors

Maintainers

Sources

notty-0.2.3.tbz
sha256=74659fb14073db4438989891ab24f24bef81aa497dac16d9a67f9a1c9c200824
sha512=6e21d44fe39f3d80884b87635bebae55cb2b931ef74f9184ba4d74cc3e51cb0b3e976c3b6dc61d377288504e8bfabe21acdc1069eacb30df1fbf6686b80f7c6b

doc/notty.lwt/Notty_lwt/Term/index.html

Module Notty_lwt.TermSource

Terminal IO with concurrency.

For more info, see Notty_unix.Term.

Sourcetype t

Construction and destruction

Sourceval create : ?dispose:bool -> ?nosig:bool -> ?mouse:bool -> ?bpaste:bool -> ?input:Lwt_unix.file_descr -> ?output:Lwt_unix.file_descr -> unit -> t

create ~dispose ~nosig ~mouse ~input ~output () creates a new terminal.

Note ~dispose arranges for the terminal to be disposed of at the end of the Lwt main loop, and not at process exit.

See Notty_unix.Term.create.

Sourceval release : t -> unit Lwt.t

Commands

Sourceval image : t -> Notty.image -> unit Lwt.t
Sourceval refresh : t -> unit Lwt.t
Sourceval cursor : t -> (int * int) option -> unit Lwt.t

Events

Sourceval events : t -> [ Notty.Unescape.event | `Resize of int * int ] Lwt_stream.t

events t is the stream of incoming events.

Invoking release will terminate this stream.

Events are:

  • #Unescape.event, an event from the input fd; or
  • `Resize (cols, rows) whenever the terminal size changes.

Note This stream is unique; for the same t, events t always returns the same stream.

Properties

Sourceval size : t -> int * int

Window size change notifications

Creating a terminal will install a SIGWINCH handler. The handler should not be replaced directly. This API allows the user to monitor deliveries of the signal.

See Notty_unix.Term.Winch.

Sourceval winch : unit -> unit Lwt.t

winch () is a thread completing after the next SIGWINCH. A single signal delivery will cause the completion of all waiting winch threads.

OCaml

Innovation. Community. Security.