Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

API reference

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

Server 5 types
Server class 65 members

Manages sessions, windows, and panes on a tmux server.

IncarnationFence class 7 members

Which tmux server incarnation a handle or batch may act on: the pid tmux reports, and its start time when known, since a pid alone is reusable — a tmux started on the pid of one just probed, as a container's first processes often are, would otherwise answer as if it were that server.

ServerConfig class 12 members

What a server needs to know before it runs anything: which tmux, which server, which config.

ServerEndpoint interface 8 members

Which tmux server to talk to.

ServerIdentity class 8 members

Which tmux server a handle belongs to.

Session 6 types
Session class 27 members

One tmux session, as one capture saw it.

SessionCreation class 1 member

Assembles the pieces Server#newSession(SessionSpec) needs before tmux has a session yet.

SessionId class 2 members

A tmux session id, such as $0.

SessionLookup class 1 member

Resolves a caller-given session name to the id tmux keeps it under.

SessionSpec class 14 members

How a session should be made.

Session_ class 5 members

Typed fields of Session, for building an expression that can be read as well as run.

Window 7 types
Window class 39 members

One tmux window at one of its positions, as one capture saw it.

WindowId class 2 members

A tmux window id, such as @1.

WindowIndex class 2 members

Where a window sits in one session.

WindowLayout interface 4 members

A window's layout as tmux reported it, in whichever of its two forms it used.

WindowPlacement enum 4 members

Where a new window is inserted relative to the current one.

WindowSpec class 13 members

How a window should be made.

Window_ class 10 members

Typed fields of Window.

Pane 12 types
Pane class 61 members

One tmux pane, as one capture saw it.

PaneCommand class 8 members

The line typed at a pane's shell to run one command to its end, and how its output is read back.

PaneEcho class 9 members

Tracks pending and recently submitted input under each server incarnation and pane id.

PaneEdges class 5 members

Which sides of its window a pane touches.

PaneId class 2 members

A tmux pane id, such as %2.

PaneInput class 7 members

One writer at a time for a pane's keyboard, paste, and shell run.

PanePosition class 3 members

Where a pane's top-left corner sits in its window, in terminal cells.

PaneRun class 6 members

How a command run in a pane with Pane#run() ended, and what it printed.

PaneSize interface 5 members

How big a new pane should be.

PaneStart interface 6 members

What runs in a new pane.

PaneWait class 3 members

Polls a pane on a timer for Pane#awaitText() and Pane#await().

Pane_ class 14 members

Typed fields of Pane.

Client 3 types
Client class 15 members

One attached tmux client, as one capture saw it.

ClientAttachment class 3 members

What a client was looking at.

Client_ class 2 members

Typed fields of Client.

Hooks 1 type
Hooks class 9 members

The tmux hooks at one scope.

Options 1 type
OptionKey class 13 members

A tmux option and the Java type its value reads as.

Keys and bindings 1 type
Keys class 5 members

The server's key bindings, in one key table or across all of them.

Buffers 2 types
BufferInfo class 2 members

One tmux paste buffer, as a listing described it.

Buffers class 7 members

The tmux server's paste buffers.

Layout and geometry 7 types
Dimensions class 3 members

How big something is, in terminal cells.

Direction enum 6 members

Which way to move or grow something.

JsonLayout class 1 member

tmux's restricted JSON grammar and layout cells, for pre-mutation workspace validation.

Layout enum 14 members

One of tmux's built-in pane arrangements.

Layouts class 3 members

Which layout names are safe to hand to tmux.

SplitDirection enum 6 members

Where a new pane goes relative to the one being split.

SplitSpec class 17 members

How a pane should be split.

Environment 2 types
Environment class 11 members

The environment tmux gives to processes it starts, at one scope.

TmuxEnvironment class 8 members

What tmux tells a program running inside one of its panes.

Versions 1 type
TmuxVersion class 12 members

A released tmux version, ordered the way tmux releases are.

Commands 13 types
CommandChain class 9 members

A sequence of tmux commands where each one acts on what the last one made.

Commands class 2 members

The commands this tmux knows, read without starting a server to answer.

MessageLog class 2 members

The server's own message log, newest last.

PrintedText class 7 members

Decodes tmux's printed output against the version the server actually reports, framed with process-local markers so a reply is read back exactly whatever quirks that version's own printing has.

Prompt class 3 members

The server's command-prompt history.

Shell class 4 members

A shell command run by tmux, and a tmux command chosen by a shell command's exit status.

DispatchOutcome enum 4 members

How certain the transport is that tmux applied a request.

Idempotence enum 3 members

Whether running a request twice leaves tmux as running it once does.

OperationObserver interface 1 member

Receives one OperationReport after each command.

OperationReport class 12 members

One command a transport finished or failed to finish.

OutputDecoder class 2 members

Turns a drained pipe into lines while preserving tmux values.

ProcessTransport class 11 members

The default transport: one child process per call, drained by a bounded pool of platform threads.

TmuxTransport interface 7 members

Runs one tmux command and blocks until it has an answer.

Control mode 11 types
ControlClient class 13 members

A tmux client that stays attached and answers one command at a time.

ControlLineReader class 5 members

Reads bounded physical lines from a control client's byte stream.

ControlProtocol class 9 members

Frames control-mode replies and encodes requests for tmux's command parser.

ControlReply class 4 members

One command's reply in control mode.

ControlWriter class 12 members

Owns the process-pipe write and the FIFO that attributes replies to requests.

Delivery interface 3 members

One step in a control subscription.

EventSubscription class 19 members

Pulls events volunteered by one control client.

Notification interface 22 members

What a control-mode notification says, typed, for matching on.

PaneOutput class 5 members

Terminal output tmux pushed without being asked.

PaneOutputDecoder class 5 members

Decodes a subscriber's raw UTF-8 output independently of other subscribers. Incomplete characters wait for the same pane's next chunk; malformed bytes become \xHH escapes. Call #reset() after each subscription gap and #finish() at termination. Confine an instance to one reader.

ControlCarrier interface 3 members

Starts a long-lived tmux process in a transport's realm.

Formats 3 types
RowFormat class 8 members

A listing template and the reader for the rows it produces.

Tokens class 2 members

The token this process marks its own text with.

TmuxFormats class 3 members

Values handed to a tmux argument position that expands formats.

Queries 4 types
Selections class 2 members

Cardinality with the ambiguity removed.

TmuxFilters class 2 members

Lowers a FilterExpr to a tmux -f format when every node is one tmux can apply.

FilterJson class 5 members

The versioned wire form of a filter expression.

FilterModel class 10 members

What a document's field and relation ids mean.

Queries — Fields 2 types
FieldRef class 5 members

A named, kinded accessor.

Fields class 10 members

Typed field handles.

Queries — Operators 1 type
Operator enum 15 members

The scalar comparisons an expression can hold. Evaluation stays a total switch.

Queries — Expressions 1 type
FilterExpr interface 11 members

A filter that is both runnable and readable.

Snapshots 12 types
CapturedServer class 8 members

Retains metadata and handles from one authenticated server capture.

CaptureSpec class 3 members

What part of a pane to read, and how.

ClientState class 2 members

A client as one capture saw it.

PaneState class 12 members

A pane as one capture saw it.

ServerMirror class 9 members

A live copy of one tmux server's sessions, windows, panes and clients, rebuilt whenever tmux announces a change.

ServerSnapshot class 14 members

One tmux hierarchy, as it was at one moment.

SessionState class 4 members

A session as one capture saw it.

WindowContext class 3 members

One tmux winlink: a window as it appears in one session, at one index.

WindowState class 7 members

A window as one capture saw it, at one of its positions.

SnapshotCapture class 8 members

Reads a whole tmux server into one snapshot.

TextOutcome enum 5 members

Why a wait for text on a pane ended.

TypedText class 4 members

Discounts input recorded by this library when reading a pane's output.

Workspaces — Plans 2 types
WorkspaceApplier class 1 member

Applies a validated workspace as one session and attempts to remove it after a failure.

WorkspaceParser class 1 member

Converts the supported YAML shape into immutable workspace values.

Requests 1 type
CommandRequest class 10 members

One tmux invocation: how to reach the server, then the commands to run there.

Errors 10 types
CardinalityException class 3 members

A lookup that required exactly one match, or at most one, did not get it.

tmux ran a command to completion and refused it.

ControlEndedException class 3 members

The control client ended, and anything reading from it will not resume.

DispatchException class 6 members

The request did not complete, with how certain it is that tmux applied it.

LibTmuxException class 4 members

The root of every operational failure this library raises.

tmux answered, and the answer did not have the shape this library asked for.

TargetGoneException class 1 member

The server answered, and the session, window, pane, buffer or server incarnation a handle addresses is gone.

Text this JVM cannot hand to tmux intact, with no route left to send it by.

The running tmux does not have something the call asked for.

SchemaException class 1 member

A document could not be read as the expression it claims to be.

Errors — Server 2 types
ServerClosedException class 2 members

A handle was used after the io.github.libtmux.Server it belongs to was closed.

No tmux daemon answered on this endpoint.

Constants and enums 7 types
BatchResult class 4 members

What became of every operation in one batch.

OperationResult class 6 members

One operation's own result within a batch.

Kind enum 6 members

What shape a facade needs to give one operation of the core API.

ControlEvent class 9 members

Something tmux volunteered, rather than an answer to a request.

Options class 13 members

The tmux options at one scope.

FieldKind enum 3 members

The value kind a field reads.

CommandResult class 5 members

One completed invocation.

Constants and enums — Pane 1 type
PaneMode enum 10 members

A mode a pane can be in, as tmux names them.

Testing utilities 12 types
FakeControlClient class 11 members

A tmux -C client of a FakeTmux, as the process a control client talks to.

FakePane class 7 members

One pane in a FakeWindow.

FakeSession class 4 members

One session in a FakeTmux, holding its windows in creation order.

FakeTmux class 12 members

A tmux server that is not there, for testing code that uses this library without starting one.

FakeWindow class 6 members

One window in a FakeSession, holding its panes in creation order.

Flags class 6 members

A command's flags and the words after them, read as tmux's argument parser reads them.

Formats class 4 members

The part of tmux's format language the library sends: variables, comparisons, && and ||, ? conditionals, and the W: and P: loops.

Groups class 1 member

Reads a command group the way tmux's command parser reads it: words in single quotes, a quote spelled '\'', a line break spelled "\n", commands separated by ;.

NamedServerFixture class 3 members

Owns the safe teardown of a tmux server addressed by socket name.

Target class 5 members

A session, one of its windows, and one of that window's panes: what a command is scoped to.

TmuxExtension class 9 members

Gives each test its own tmux server and checks its exit during teardown.

TmuxSocketPath class 1 member

The socket a fixture server is listening on.

Internal 7 types
ControlAcquisition class 10 members

Qualifies a carrier-owned endpoint before the first control effect.

ErrorText class 1 member

What tmux printed on its error stream, as it appears in a failure's message.

LocalSocketPin class 3 members

A pin created only by carriers that own this filesystem.

Capabilities class 21 members

What the supported daemons can do, and the release defects this library works around.

Versions class 5 members

The tmux version check shared by command dispatch and control-client startup.

TmuxFeatures class 2 members

Feature boundaries for literal commands and the commands hidden by managed guards.

Utf8 class 5 members

The UTF-8 boundary shared by process and control transports, in both directions.

Internal — Commands 2 types
CommandStrings class 3 members

Encodes a tmux command for each of the two parsers tmux reads commands with.

ProcessTree class 3 members

Owns bounded, idempotent termination of one process and its observable descendants.

Other 10 types
Batch class 5 members

Several tmux commands in one invocation, each with an outcome of its own.

OperationOutcome enum 4 members

What became of one operation in a batch.

Advanced interface

Public for orchestration across processes or clients, such as the MCP server's pane reservations; not part of the surface a language facade mirrors.

Operation interface 2 members

Classifies one public method of the core API as a tmux operation of a given Kind.

Channel class 7 members

One of tmux's wait-for channels, named once.

Names class 1 member

What the running tmux does with a session or window name.

TargetIds class 1 member

Shared validation for the sigil-prefixed ids tmux hands out.

TextWait class 2 members

How a wait for text on a pane ended, and what the pane had shown by then.

WakeReason enum 3 members

Why a wait on a tmux channel ended.

LibTmuxModels class 4 members

The wire ids for this library's own entities.

By module 16 modules

Esc

Type to search.

Reference previewOpen reference