# API reference

Source: https://libtmux.org/en/scala/latest/reference/

> Types, methods, and functions in libtmux for Scala.

Scala API

Find a type or member

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](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-server/)

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` ](https://libtmux.org/en/java/latest/reference/io-github-libtmux-catalog-kind-kind-wait/), [`STREAM` ](https://libtmux.org/en/java/latest/reference/io-github-libtmux-catalog-kind-kind-stream/)or [`LIFECYCLE` ](https://libtmux.org/en/java/latest/reference/io-github-libtmux-catalog-kind-kind-lifecycle/). Closing an owned client releases its transport, not tmux; [`close()` ](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-streaming-observation-close/)comes from the [`AutoCloseable` ](https://docs.oracle.com/en/java/javase/21/docs/api/java/lang/AutoCloseable.html)bound with no forwarding of its own, so `Using.resource(server) { ... }` works.

[Server 43 members](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-server/)

Cats Effect

A tmux server whose operations run in the effect type [`F` ](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-server/).

[LiveServer 3 members](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-liveserver/)

Observe a tmux server through a continuously updated [`signal` ](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-liveserver-signal/).

Session 2 types

[Session 25 members](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-session/)

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` ](https://libtmux.org/en/java/latest/reference/io-github-libtmux-catalog-kind-kind-wait/), [`STREAM` ](https://libtmux.org/en/java/latest/reference/io-github-libtmux-catalog-kind-kind-stream/)or [`LIFECYCLE` ](https://libtmux.org/en/java/latest/reference/io-github-libtmux-catalog-kind-kind-lifecycle/).

[Session 26 members](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-session/)

Cats Effect

A tmux session whose operations run in the effect type [`F` ](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-session/).

Window 2 types

[Window 39 members](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-window/)

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` ](https://libtmux.org/en/java/latest/reference/io-github-libtmux-catalog-kind-kind-wait/), [`STREAM` ](https://libtmux.org/en/java/latest/reference/io-github-libtmux-catalog-kind-kind-stream/)or [`LIFECYCLE` ](https://libtmux.org/en/java/latest/reference/io-github-libtmux-catalog-kind-kind-lifecycle/).

[Window 38 members](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-window/)

Cats Effect

A tmux window at a specific session position, with operations in the effect type [`F` ](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-window/).

Pane 2 types

[Pane 62 members](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-pane/)

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` ](https://libtmux.org/en/java/latest/reference/io-github-libtmux-catalog-kind-kind-wait/), [`STREAM` ](https://libtmux.org/en/java/latest/reference/io-github-libtmux-catalog-kind-kind-stream/)or [`LIFECYCLE` ](https://libtmux.org/en/java/latest/reference/io-github-libtmux-catalog-kind-kind-lifecycle/).

[Pane 54 members](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-pane/)

Cats Effect

A tmux pane with input, output, and layout operations in the effect type [`F` ](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-pane/).

Client 2 types, 1 function or constant

[Client 12 members](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-client/)

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` ](https://libtmux.org/en/java/latest/reference/io-github-libtmux-catalog-kind-kind-wait/), [`STREAM` ](https://libtmux.org/en/java/latest/reference/io-github-libtmux-catalog-kind-kind-stream/)or [`LIFECYCLE` ](https://libtmux.org/en/java/latest/reference/io-github-libtmux-catalog-kind-kind-lifecycle/).

[Client 14 members](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-client/)

Cats Effect

An attached tmux client with operations in the effect type [`F` ](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-client/).

[matching function](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-vector-matching/)

The captured clients [`expr` ](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-vector-matching/#io.github.libtmux.scaladsl.Vector.matching.parameter.expr)matches: a local filter over what is already held.

Hooks 1 type

[Hooks 10 members](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-hooks/)

Read and update tmux hooks through the owning [`server` ](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-hooks-server/).

Keys and bindings 1 type

[Keys 9 members](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-keys/)

Read and update bindings in tmux key tables.

Buffers 1 type

[Buffers 11 members](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-buffers/)

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

Environment 1 type

[Environment 14 members](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-environment/)

Read and update environment variables for processes started by tmux.

Commands 6 types

[Batch 5 members](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-batch/)

An immutable batch plan. Construction does no tmux I/O and never touches a shared Java object: each [`add` ](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-batch-add/)returns a new value holding one more argument vector. Each [`run` ](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-batch-run/)/[ `length` ](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-batch-length/)builds a fresh Java [`Batch` ](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-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](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-commandchain/)

An immutable plan using tmux's evolving current target. Construction does no tmux I/O; each [`run` ](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-commandchain-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](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-shell/)

Run shell commands through tmux in the effect type [`F` ](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-shell/).

[Commands 6 members](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-commands/)

Inspect the commands supported by the selected tmux executable.

[MessageLog 6 members](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-messagelog/)

Read messages recorded by the tmux server.

[Prompt 7 members](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-prompt/)

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

Control mode 3 types

[Channel 3 members](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-channel/)

One of tmux's wait-for channels. [`signal` ](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-channel-signal/)is a real dispatch (tmux's own `wait-for -S`), routed through `Execution#apply` like any other mutation; [`await` ](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-channel-await/)reserves this server's shared-wait capacity the way every other handwritten [`WAIT` ](https://libtmux.org/en/java/latest/reference/io-github-libtmux-catalog-kind-kind-wait/)operation does, since a Cats caller waiting and the caller releasing it usually share this same bounded transport.

[Control 11 members](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-control/)

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](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-ox-flows/)

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` ](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-live-liveview/)already give a blocking caller, expressed as a cold `Flow` instead of an [`Iterator` ](https://docs.oracle.com/en/java/javase/21/docs/api/java/util/Iterator.html).

Queries 2 functions and constants

[atMostOne function](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-query-iterableonce-atmostone/)

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

[exactlyOne function](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-query-iterableonce-exactlyone/)

The single match, or a failure naming which way the count was wrong. Single-pass: mirrors [`Selections.exactlyOne` ](https://libtmux.org/en/java/latest/reference/io-github-libtmux-query-selections-selections-exactlyone/)'s early exit, stopping at the second match.

Queries — Fields 5 types

[PaneFields 14 members](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-generated-panefields/)

Typed fields for filtering captured pane objects.

[SessionFields 5 members](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-generated-sessionfields/)

Typed fields for filtering captured session objects.

[WindowFields 10 members](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-generated-windowfields/)

Typed fields for filtering captured window objects.

[ClientFields 2 members](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-generated-clientfields/)

Typed fields for filtering captured client objects.

[Fields 5 members](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-query-fields/)

Typed field handles, wrapping Java's [`io.github.libtmux.query.Fields` ](https://libtmux.org/en/java/latest/reference/io-github-libtmux-query-fields-fields/)records so every operator returns this facade's [`Expr` ](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-query-expr-zfkn/)rather than a raw Java [`FilterExpr` ](https://libtmux.org/en/java/latest/reference/io-github-libtmux-query-filterexpr-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](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-query-expr-zfkn/)

A filter over [`T` ](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-query-expr-zfkn/), both runnable and readable, opaque over Java's own `FilterExpr[T]` — lossless by construction, the same reasoning [`io.github.libtmux.scaladsl.Pane` ](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-pane/)and its siblings rest on. [`T` ](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-query-expr-zfkn/)is the raw Java handle type a Java field metamodel ([ `Pane_` ](https://libtmux.org/en/java/latest/reference/io-github-libtmux-pane_-pane_/), [`Session_` ](https://libtmux.org/en/java/latest/reference/io-github-libtmux-session_-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](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-instances/)

Instances derived from Java's `equals`/`hashCode`/`toString`, and from [`TmuxVersion` ](https://libtmux.org/en/java/latest/reference/io-github-libtmux-tmuxversion-tmuxversion/)'s own [`Comparable` ](https://docs.oracle.com/en/java/javase/21/docs/api/java/lang/Comparable.html)— the one handle-adjacent type that actually has a natural order. None of [`Server` ](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-server/), [`Session` ](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-session/), [`Window` ](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-window/), [`Pane` ](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-pane/)or [`Client` ](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-client/)implements [`Comparable` ](https://docs.oracle.com/en/java/javase/21/docs/api/java/lang/Comparable.html)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` ](https://docs.oracle.com/en/java/javase/21/docs/api/java/util/SortedSet.html)producing an ordering nobody asked for.

[Observation 6 members](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-observation/)

Cats Effect

Pulls a bounded Java subscription with one active stream consumer. A full buffer yields a [`Delivery.Gap` ](https://libtmux.org/en/java/latest/reference/io-github-libtmux-control-delivery-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](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-live-liveview/)

A live view of one tmux server's sessions, windows, panes and clients, opaque over Java's own [`ServerMirror` ](https://libtmux.org/en/java/latest/reference/io-github-libtmux-snapshot-servermirror-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()` ](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-streaming-observation-close/)comes from the [`AutoCloseable` ](https://docs.oracle.com/en/java/javase/21/docs/api/java/lang/AutoCloseable.html)bound with no forwarding of its own.

[Observation 4 members](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-streaming-observation/)

Direct API

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

Errors 1 type

[CardinalityError 3 members](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-query-cardinalityerror/)

Mirrors [`CardinalityException` ](https://libtmux.org/en/java/latest/reference/io-github-libtmux-exception-cardinalityexception-cardinalityexception/)'s two leaves losslessly, including the match count Java's own [`MultipleMatches.atLeast()` ](https://libtmux.org/en/java/latest/reference/io-github-libtmux-exception-cardinalityexception-cardinalityexception-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](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-options/)

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

## By module 9 modules

* io.github.libtmux.scaladsl 5

  * [Client](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-client/)
  * [Pane](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-pane/)
  * [Server](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-server/)
  * [Session](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-session/)
  * [Window](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-window/)

* io.github.libtmux.scaladsl.cats 21

  * [Batch](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-batch/)
  * [Buffers](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-buffers/)
  * [Channel](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-channel/)
  * [Client](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-client/)
  * [Command​Chain](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-commandchain/)
  * [Commands](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-commands/)
  * [Control](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-control/)
  * [Environment](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-environment/)
  * [Hooks](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-hooks/)
  * [Keys](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-keys/)
  * [Live​Server](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-liveserver/)
  * [Message​Log](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-messagelog/)
  * [Observation](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-observation/)
  * [Options](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-options/)
  * [Pane](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-pane/)
  * [Prompt](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-prompt/)
  * [Server](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-server/)
  * [Session](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-session/)
  * [Shell](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-shell/)
  * [Window](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-window/)
  * [Instances](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-cats-instances/)

* io.github.libtmux.scaladsl.generated 4

  * [Client​Fields](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-generated-clientfields/)
  * [Pane​Fields](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-generated-panefields/)
  * [Session​Fields](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-generated-sessionfields/)
  * [Window​Fields](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-generated-windowfields/)

* io.github.libtmux.scaladsl.live 1

  * [Live​View](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-live-liveview/)

* io.github.libtmux.scaladsl.ox 1

  * [Flows](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-ox-flows/)

* io.github.libtmux.scaladsl.query 3

  * [Cardinality​Error](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-query-cardinalityerror/)
  * [Fields](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-query-fields/)
  * [Expr](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-query-expr-zfkn/)

* io.github.libtmux.scaladsl.streaming 1

  * [Observation](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-streaming-observation/)

* io.github.libtmux.scaladsl.Vector 1

  * [matching](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-vector-matching/)

* io.github.libtmux.scaladsl.query.IterableOnce 2

  * [at​Most​One](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-query-iterableonce-atmostone/)
  * [exactly​One](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-query-iterableonce-exactlyone/)
