Core LibraryAPI Reference

Choose documentation 1

latest

Current version

latest
English

Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

API reference

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

Server 3 types
Server 46 members

Direct API

The Java client, opaque: every member beyond java.lang.AutoCloseable#close is an extension, generated from the operation catalog or handwritten where the catalog marks it WAIT , STREAM or LIFECYCLE . Closing an owned client releases its transport, not tmux; close() comes from the AutoCloseable bound with no forwarding of its own, so Using.resource(server) { ... } works.

Server 43 members

Cats Effect

A tmux server whose operations run in the effect type F .

LiveServer 3 members

Observe a tmux server through a continuously updated signal .

Session 2 types
Session 25 members

Direct API

A captured session, opaque over the Java handle; every operation beyond equality is an extension, generated from the operation catalog or handwritten where the catalog marks it WAIT , STREAM or LIFECYCLE .

Session 26 members

Cats Effect

A tmux session whose operations run in the effect type F .

Window 2 types
Window 39 members

Direct API

One captured window placement, opaque over the Java handle. Equality includes its session and index, since a window linked into more than one session has more than one placement. Every operation beyond equality is an extension, generated from the operation catalog or handwritten where the catalog marks it WAIT , STREAM or LIFECYCLE .

Window 38 members

Cats Effect

A tmux window at a specific session position, with operations in the effect type F .

Pane 2 types
Pane 62 members

Direct API

A captured pane occurrence, opaque over the Java handle. Java equality identifies the physical pane; every operation beyond that is an extension, generated from the operation catalog or handwritten where the catalog marks it WAIT , STREAM or LIFECYCLE .

Pane 54 members

Cats Effect

A tmux pane with input, output, and layout operations in the effect type F .

Client 2 types, 1 function or constant
Client 12 members

Direct API

A captured attached client, opaque over the Java handle. Every operation beyond equality is an extension, generated from the operation catalog or handwritten where the catalog marks it WAIT , STREAM or LIFECYCLE .

Client 14 members

Cats Effect

An attached tmux client with operations in the effect type F .

matching function

The captured clients expr matches: a local filter over what is already held.

Hooks 1 type
Hooks 10 members

Read and update tmux hooks through the owning server .

Keys and bindings 1 type
Keys 9 members

Read and update bindings in tmux key tables.

Buffers 1 type
Buffers 11 members

Read, create, and remove the server's paste buffers.

Environment 1 type
Environment 14 members

Read and update environment variables for processes started by tmux.

Commands 6 types
Batch 5 members

An immutable batch plan. Construction does no tmux I/O and never touches a shared Java object: each add returns a new value holding one more argument vector. Each run / length builds a fresh Java Batch from create and dispatches it through Execution, so it is F-suspended, cancellation-safe, and admission-bounded like every other Cats operation — cancelling one run never disturbs a concurrent one, since neither shares Java state.

CommandChain 8 members

An immutable plan using tmux's evolving current target. Construction does no tmux I/O; each run builds a fresh Java chain from create and dispatches it through Execution, F-suspended and cancellation-safe like every other Cats operation.

Shell 8 members

Run shell commands through tmux in the effect type F .

Commands 6 members

Inspect the commands supported by the selected tmux executable.

MessageLog 6 members

Read messages recorded by the tmux server.

Prompt 7 members

Read and clear the server's command-prompt history.

Control mode 3 types
Channel 3 members

One of tmux's wait-for channels. signal is a real dispatch (tmux's own wait-for -S), routed through Execution#apply like any other mutation; await reserves this server's shared-wait capacity the way every other handwritten WAIT operation does, since a Cats caller waiting and the caller releasing it usually share this same bounded transport.

Control 11 members

Owns an attached Java control client. Canceling an active request can end this attachment and its queued requests and observations. Use separate attachments for commands and observations that must survive that failure.

Flows 2 members

An Ox Flow over a subscription or a live view, for a supervised scope. Ox adds no new handle type (io.github.libtmux.scaladsl's opaque handles work unchanged inside a fork); what it needs from this project is the same single-owner discipline the direct-style Observation and LiveView already give a blocking caller, expressed as a cold Flow instead of an Iterator .

Queries 2 functions and constants
atMostOne function

The single match if there is one, None if there is none — still a failure for several.

exactlyOne function

The single match, or a failure naming which way the count was wrong. Single-pass: mirrors Selections.exactlyOne 's early exit, stopping at the second match.

Queries — Fields 5 types
PaneFields 14 members

Typed fields for filtering captured pane objects.

SessionFields 5 members

Typed fields for filtering captured session objects.

WindowFields 10 members

Typed fields for filtering captured window objects.

ClientFields 2 members

Typed fields for filtering captured client objects.

Fields 5 members

Typed field handles, wrapping Java's io.github.libtmux.query.Fields records so every operator returns this facade's Expr rather than a raw Java FilterExpr . An extension cannot reshape these methods' return type on the Java records directly — same-named would silently lose to the Java member, exactly the trap -Werror exists to catch — so each kind gets its own small Scala class instead, one line per operator, forwarding to the Java one underneath.

Queries — Expressions 1 type
Expr 10 members

A filter over T , both runnable and readable, opaque over Java's own FilterExpr[T] — lossless by construction, the same reasoning io.github.libtmux.scaladsl.Pane and its siblings rest on. T is the raw Java handle type a Java field metamodel ( Pane_ , Session_ , ...) is built over, not this facade's opaque one: a query is a Java-shaped value that this facade's own matching extensions apply to captured Scala handles.

Snapshots 4 types
Instances 13 members

Instances derived from Java's equals/hashCode/toString, and from TmuxVersion 's own Comparable — the one handle-adjacent type that actually has a natural order. None of Server , Session , Window , Pane or Client implements Comparable in Java, and none has a domain-meaningful order (a pane's tmux index is not identity, and two panes can share an index across different windows), so those get Eq/Show/Hash only — never a manufactured Order that invites sorted/ SortedSet producing an ordering nobody asked for.

Observation 6 members

Cats Effect

Pulls a bounded Java subscription with one active stream consumer. A full buffer yields a Delivery.Gap in this stream before the events that remain. FS2 demand does not provide tmux backpressure. A subscription does not reconnect: attach again and read a snapshot.

LiveView 8 members

A live view of one tmux server's sessions, windows, panes and clients, opaque over Java's own ServerMirror — re-snapshotting on notification, on a gap and on reconnect is entirely Java's job; this only wraps it, rather than re-deriving resnapshot-on-notification from a raw control subscription. close() comes from the AutoCloseable bound with no forwarding of its own.

Observation 4 members

Direct API

A single-consumer guard over one Java subscription, for direct-style reading.

Errors 1 type
CardinalityError 3 members

Mirrors CardinalityException 's two leaves losslessly, including the match count Java's own MultipleMatches.atLeast() carries — dropping it would be exactly the hand-authored lossy projection this facade's opaque handles exist to make impossible everywhere else.

Constants and enums 1 type
Options 13 members

Read and update options on the server, session, window, or pane that owns this handle.

By module 9 modules

Esc

Type to search.