Core LibraryunreleasedAPI Reference

Choose documentation 2

latest

Current version

latest
English

Unreleased libtmux has not been released. Its API may change during development. This site's structure and URLs may change too.

OCaml API

API reference

Browse the OCaml types and operations for working with tmux. Start with the core objects below, or search for a type or member.

Server 5 functions and constants
Client module In Libtmux_unix 60 members

An explicit generation-bound connection. Applications retain ownership of the endpoint choice and resource lifetime.

Client module In Libtmux_eio 60 members

An explicit generation-bound connection. Applications retain ownership of the endpoint choice and resource lifetime.

Endpoint module 7 members

An explicit socket description. Constructing an endpoint neither reads the environment nor starts a daemon. Source.t adds the observed daemon and connection generation.

Source module 6 members

Endpoint and observed daemon identity for one connection generation. Constructing metadata alone does not establish a live binding.

Generation module 4 members

A random connection-generation identifier. Reconnecting creates a new generation even when the socket and server PID are unchanged.

Session 1 function or constant
Session module 15 members

A captured session and its ordered window-link contexts. A session can contain repeated links to the same global window.

Window 2 functions and constants
Window module 17 members

A global window shared by its session links. Window index and current state belong to a link, while panes and geometry belong to the window.

Pane 1 function or constant
Pane module 23 members

A captured pane with local geometry, process metadata and a window relationship. Use Pane.target for explicit actions; reading the observation never refreshes it.

Client 2 functions and constants
Client_name module 3 members
Client_observation module 12 members
Hooks 1 function or constant
Hook module 1 member
Options 1 function or constant
Options module 10 members

Version-aware option descriptors and captured scoped values. Sparse array indexes and inherited entries retain their tmux meaning.

Keys and bindings 1 function or constant
Key module 1 member
Layout and geometry 2 functions and constants
Geometry module 2 members
Layout module 1 member
Environment 1 function or constant
Environment module 5 members
Terminal capabilities 2 functions and constants
Terminal module In Libtmux_eio 1 member

Interactive attachment using borrowed application streams. This utility addresses the current daemon explicitly and does not reuse captured targets.

Terminal module In Libtmux_unix 1 member

Interactive attachment using borrowed application streams. This utility addresses the current daemon explicitly and does not reuse captured targets.

Commands 1 type, 5 functions and constants
Libtmux module 32 members

Native captured values, typed queries and explicit command descriptions.

Command module 4 members

Typed descriptions of explicit acquisition and mutation operations. Construction performs no I/O; a backend validates and admits the command.

Created module 1 member

IDs reported by a successful creation reply. Only the requested kind is newly created; the other fields can describe existing containers.

ID interface 6 members
Operations module 49 members

Construct typed tmux operations for a backend client. Observations are immutable, mutations use explicit targets, and no command retries a mutation against another connection generation. Construction performs no I/O; the descriptions below state what execution does.

Spawn module 4 members

A process description with explicit argv or shell semantics, working directory and environment. Describing a process performs no I/O.

Control mode 6 functions and constants
Output module 5 members

Future observed pane bytes, local cursors and explicit continuity loss. Output cursors are unrelated to snapshot times or server-side history.

Operation module In Libtmux_eio 7 members

A retained admitted command. A cancelled waiter does not erase its eventual success, failure or uncertainty.

Subscription module In Libtmux_eio 5 members

Bounded future-byte observation with Data/Gap/End and local cursors. Polling is local; waiting and admission belong to the backend.

Cancellation module 4 members
Operation module In Libtmux_unix 6 members

Retained outcomes remain inspectable after client closure, on the owning domain. Keep the handle from Client.submit before Client.await, then read Operation.inspect. The hook recovery walkthrough shows creation evidence after a later hook failure.

Subscription module In Libtmux_unix 5 members

Bounded future-byte observation with Data/Gap/End and local cursors. Polling is local; waiting and admission belong to the backend.

Formats 1 function or constant
Formats module 9 members
Queries 5 functions and constants
Cardinality module 2 members
Model module 9 members

Built-in model witnesses and canonical field lookup for typed codecs. Untrusted field names must resolve against the selected model.

Plan module 9 members

Explicit source-filter planning for a new acquisition. A plan separates supported tmux predicates from residual local evaluation; it never changes the I/O-free contract of Query.matching. Backend capture operations acquire a complete graph and do not consume these plans.

Query module 3 members

Sequence adapters and bounded cardinality checks over captured values. Matching preserves order and duplicates. Expected absence and ambiguity remain ordinary result values.

Relation module 3 members

Typed edges in a captured graph. Many, one and optional relations are distinct; an unacquired relationship is never represented as an empty one.

Queries — Fields 1 function or constant
Field module 6 members

Sealed scalar descriptors carrying entity and value types. Descriptors read captured data and provide trusted identities for Expr values. Use Relation for graph edges.

Queries — Expressions 2 functions and constants
Expr module In Libtmux 14 members

Inspectable predicates whose entity and operand types are checked by the compiler. Combine native closures separately with Seq.filter. Evaluation follows captured relationships without acquisition or hidden caches.

Expr module In Libtmux_json 4 members

Portable scalar pane expressions. See the wire subset for canonical fields, operators and bounds.

Snapshots 4 functions and constants
Captured_text module 1 member
Snapshot module 16 members

A complete immutable graph captured over an acquisition interval. Collections are replayable immutable arrays. Capturing several tmux commands does not establish an atomic transaction.

Rendered module In Libtmux_eio
Rendered module In Libtmux_unix

Blocking native Linux transport. No Eio scheduler is started.

Errors 5 functions and constants
Error module In Libtmux 2 members

Expected input, capture, capability and transport failures. Cancellation belongs to the chosen backend and is not converted into an ordinary error.

Cleanup module In Libtmux_eio

Domain-owned cleanup diagnostics shared with the blocking backend. Supply a report before setup to inspect secondary failures after native cancellation. No scheduler is needed to inspect a report.

Decode_error module 3 members
Error module In Libtmux_json 1 member

Structured native failures for JSON consumers.

Cleanup module In Libtmux_unix 6 members

Retained failures from releasing processes and descriptors. Reports belong to their creating domain and remain readable after client closure. They preserve secondary failures without replacing a primary exception or cancellation.

Runtime adapters 3 types
Libtmux_eio module 7 members

Concurrent Linux tmux clients using the application's Eio scheduler.

Libtmux_json module 4 members

Pure, bounded query and workspace JSON interchange.

Libtmux_unix module 8 members

Blocking Linux tmux clients with explicit scoped cancellation.

Esc

Type to search.

Reference previewOpen reference