package notty-community

  1. Overview
  2. Docs
Declaring terminals

Install

dune-project
 Dependency

Authors

Maintainers

Sources

notty-community-0.2.4.tar.gz
md5=b8cb51edb37d28d9d53e98ac52848677
sha512=8922a190a412790285603ba7ab37f9f58202d9406ebc9e6d3329189eac7fda5c25316264c27b6f7decb8f25f0d78801873b9f16c40e90f020e2c06ab9d058686

doc/notty-community.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.