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 Rust types and operations for working with tmux. Start with the core objects below, or search for a type or member.

Server 13 types
Server struct 97 members

A cloneable handle to one captured tmux server endpoint.

Principal enum 2 members

Whether an AccessRule names an operating-system user or group.

AccessRule struct 3 members

One entry of the server's access list.

ChannelWait enum 2 members

What came of waiting on a wait-for channel.

Chooser enum 4 members

One of tmux's interactive choosers.

ServerBuilder struct 10 members

A consuming builder for one inert Server handle.

SessionTree struct 2 members

One session and everything under it, from Server::hierarchy().

WindowTree struct 2 members

One window and its panes, from Server::hierarchy().

SessionTreeFields struct 2 members

Typed filter handles for SessionTree.

WindowTreeFields struct 2 members

Typed filter handles for WindowTree.

MenuItem struct 4 members

One line of a Server::display_menu() menu.

ServerGeneration struct 2 members

Which tmux daemon is answering on an endpoint.

The structural identity of one tmux server endpoint.

Session 4 types
Session struct 48 members

One tmux session, together with the snapshot it was discovered with.

WindowPlacement enum 2 members

Where a new window goes, relative to the index it is given.

SessionName struct 2 members

A session name tmux can address.

SessionId struct

A native tmux session ID such as $1.

Window 4 types
Window struct 57 members

One tmux window, as reached through one session that links it.

Respawn enum 2 members

What to do about a process still running where one is being respawned.

PaneSize enum 2 members

How much space a new pane gets.

WindowId struct

A native tmux window ID such as @1.

Pane 4 types
Pane struct 73 members

One tmux pane, as reached through one window link.

PaneWait enum 3 members

What came of waiting for a pane to do something.

PaneDirection enum 4 members

Which way to move focus among a window's panes.

PaneId struct

A native tmux pane ID such as %1.

Client 1 type
Client struct 21 members

One client attached to the tmux server.

Hooks 1 type, 1 function or constant
SparseValues struct 8 members

The values one array option holds, by the index tmux stores them under.

IndexedHooks type alias

The commands one hook name holds.

Options 4 types
OptionScope enum 4 members

Which table an option primarily lives in.

OptionSchema struct 6 members

What tmux declares about one option.

OptionValueRefusal enum 3 members

Why a typed option write was refused before it reached tmux.

OptionValue enum 3 members

One option's value, typed by what tmux's own option table declares.

Options — Functions 1 function or constant
option_schema function

Look up what tmux declares about one option.

Options — Constants and variables 217 functions and constants

tmux's activity-action option.

tmux's after-bind-key option.

tmux's after-capture-pane option.

tmux's after-copy-mode option.

tmux's after-kill-pane option.

tmux's after-list-buffers option.

tmux's after-list-clients option.

tmux's after-list-keys option.

tmux's after-list-panes option.

tmux's after-list-windows option.

tmux's after-load-buffer option.

tmux's after-lock-server option.

tmux's after-new-session option.

tmux's after-new-window option.

tmux's after-paste-buffer option.

tmux's after-pipe-pane option.

AFTER_QUEUE constant

tmux's after-queue option.

tmux's after-resize-pane option.

tmux's after-save-buffer option.

tmux's after-select-pane option.

tmux's after-send-keys option.

tmux's after-set-buffer option.

tmux's after-set-hook option.

tmux's after-set-option option.

tmux's after-show-options option.

tmux's after-split-window option.

tmux's after-unbind-key option.

tmux's aggressive-resize option.

tmux's alert-activity option.

ALERT_BELL constant

tmux's alert-bell option.

ALERT_SILENCE constant

tmux's alert-silence option.

tmux's allow-passthrough option.

ALLOW_RENAME constant

tmux's allow-rename option.

tmux's allow-set-title option.

tmux's alternate-screen option.

tmux's assume-paste-time option.

tmux's automatic-rename option.

BACKSPACE constant

tmux's backspace option.

BASE_INDEX constant

tmux's base-index option.

BELL_ACTION constant

tmux's bell-action option.

BUFFER_LIMIT constant

tmux's buffer-limit option.

CLIENT_ACTIVE constant

tmux's client-active option.

tmux's client-attached option.

tmux's client-dark-theme option.

tmux's client-detached option.

tmux's client-focus-in option.

tmux's client-focus-out option.

tmux's client-light-theme option.

tmux's client-resized option.

tmux's clock-mode-colour option.

tmux's clock-mode-style option.

tmux's codepoint-widths option.

COMMAND_ALIAS constant

tmux's command-alias option.

COMMAND_ERROR constant

tmux's command-error option.

COPY_COMMAND constant

tmux's copy-command option.

CURSOR_COLOUR constant

tmux's cursor-colour option.

CURSOR_STYLE constant

tmux's cursor-style option.

tmux's default-command option.

DEFAULT_SHELL constant

tmux's default-shell option.

DEFAULT_SIZE constant

tmux's default-size option.

tmux's default-terminal option.

tmux's destroy-unattached option.

tmux's detach-on-destroy option.

tmux's display-panes-time option.

DISPLAY_TIME constant

tmux's display-time option.

EDITOR constant

tmux's editor option.

ESCAPE_TIME constant

tmux's escape-time option.

EXIT_EMPTY constant

tmux's exit-empty option.

tmux's exit-unattached option.

EXTENDED_KEYS constant

tmux's extended-keys option.

tmux's fill-character option.

FOCUS_EVENTS constant

tmux's focus-events option.

GET_CLIPBOARD constant

tmux's get-clipboard option.

HISTORY_FILE constant

tmux's history-file option.

HISTORY_LIMIT constant

tmux's history-limit option.

tmux's input-buffer-size option.

KEY_TABLE constant

tmux's key-table option.

tmux's lock-after-time option.

LOCK_COMMAND constant

tmux's lock-command option.

tmux's main-pane-height option.

tmux's main-pane-width option.

tmux's menu-border-lines option.

tmux's menu-border-style option.

MENU_STYLE constant

tmux's menu-style option.

tmux's message-format option.

MESSAGE_LIMIT constant

tmux's message-limit option.

MESSAGE_LINE constant

tmux's message-line option.

MESSAGE_STYLE constant

tmux's message-style option.

MODE_KEYS constant

tmux's mode-keys option.

MODE_STYLE constant

tmux's mode-style option.

tmux's monitor-activity option.

MONITOR_BELL constant

tmux's monitor-bell option.

tmux's monitor-silence option.

MOUSE constant

tmux's mouse option.

tmux's other-pane-height option.

tmux's other-pane-width option.

tmux's pane-base-index option.

tmux's pane-border-format option.

tmux's pane-border-lines option.

tmux's pane-border-status option.

tmux's pane-border-style option.

PANE_COLOURS constant

tmux's pane-colours option.

PANE_DIED constant

tmux's pane-died option.

PANE_EXITED constant

tmux's pane-exited option.

PANE_FOCUS_IN constant

tmux's pane-focus-in option.

tmux's pane-focus-out option.

tmux's pane-mode-changed option.

tmux's pane-scrollbars option.

tmux's pane-set-clipboard option.

tmux's pane-status-style option.

tmux's pane-title-changed option.

tmux's popup-border-lines option.

tmux's popup-border-style option.

POPUP_STYLE constant

tmux's popup-style option.

PREFIX constant

tmux's prefix option.

tmux's prefix-timeout option.

PREFIX2 constant

tmux's prefix2 option.

tmux's remain-on-exit option.

tmux's renumber-windows option.

REPEAT_TIME constant

tmux's repeat-time option.

tmux's scroll-on-clear option.

tmux's session-closed option.

tmux's session-created option.

tmux's session-renamed option.

SET_CLIPBOARD constant

tmux's set-clipboard option.

SET_TITLES constant

tmux's set-titles option.

tmux's set-titles-string option.

tmux's silence-action option.

STATUS constant

tmux's status option.

STATUS_BG constant

tmux's status-bg option.

STATUS_FG constant

tmux's status-fg option.

STATUS_FORMAT constant

tmux's status-format option.

tmux's status-interval option.

tmux's status-justify option.

STATUS_KEYS constant

tmux's status-keys option.

STATUS_LEFT constant

tmux's status-left option.

tmux's status-left-length option.

tmux's status-left-style option.

tmux's status-position option.

STATUS_RIGHT constant

tmux's status-right option.

tmux's status-right-style option.

STATUS_STYLE constant

tmux's status-style option.

tmux's synchronize-panes option.

tmux's terminal-features option.

tmux's terminal-overrides option.

tmux's update-environment option.

USER_KEYS constant

tmux's user-keys option.

tmux's visual-activity option.

VISUAL_BELL constant

tmux's visual-bell option.

tmux's visual-silence option.

WINDOW_LINKED constant

tmux's window-linked option.

WINDOW_SIZE constant

tmux's window-size option.

WINDOW_STYLE constant

tmux's window-style option.

tmux's window-unlinked option.

tmux's word-separators option.

XTERM_KEYS constant

tmux's xterm-keys option.

Keys and bindings 1 type
KeyBinding struct 5 members

One key binding, as tmux holds it.

Layout and geometry 5 types
Rotation enum 2 members

Where a split puts the new pane, relative to the one being divided.

Layout enum 9 members

One of the pane arrangements tmux knows by name.

LayoutSpec enum 2 members

What to arrange a window's panes as.

SplitDirection enum 4 members

Where a split puts the pane it makes.

ResizeDirection enum 4 members

Which edge a resize moves.

Environment 1 type
EnvironmentEntry enum 2 members

What a session's environment holds for one name.

Terminal capabilities 1 type
EngineCapabilities struct 1 member

Immutable capability state detected for one configured tmux executable.

Versions 3 types, 11 functions and constants
ReleaseSuffix struct 8 members

The suffix of a numbered tmux release.

ReleaseVersion struct 4 members

A numbered tmux release.

TmuxVersion struct 8 members

A parsed raw tmux version.

list-clients leaving out a client that is stopped rather than gone, and so crate::Error::ClientSuspended being reachable at all.

refresh-client -l, which asks an attached client's terminal for its clipboard.

Managed control acquisition, decided before -C.

Taking a pane out of a control client's stream without crashing the server, and so crate::control::ControlSender::mute_pane() using off.

JSON_LAYOUTS constant

window_layout and select-layout using a JSON subset instead of the classic checksum-prefixed string, and so crate::LayoutSpec::Saved accepting one.

pane-border-style and pane-active-border-style becoming pane options as well as window ones, below it tmux stores them only per window, and a write sent with -p lands there instead -- reporting success for a change the caller did not ask for. See crate::OptionSchema::accepts().

Commands 5 types
Command struct 5 members

A logical tmux command with classified diagnostic arguments.

CommandChain struct 4 members

Several tmux commands dispatched as one tmux a \; b invocation.

CommandSummary struct 3 members

A rendering of a dispatched command that is safe to log.

DispatchLimits struct 4 members

How much work one server may have in flight at once.

TmuxArg struct 3 members

Text bound for a tmux argument that tmux expands as a format.

Control mode 6 types
Subscription enum 5 members

What a subscription watches.

ControlSender struct 10 members

Sends commands down a control-mode connection.

ControlEvents struct 2 members

Receives tmux notifications and terminal connection errors.

PaneOutput struct 5 members

What one pane writes, as it writes it.

ControlClientLimits struct 4 members

How many persistent control-mode clients one server may hold.

ControlLimits struct 6 members

What one control-mode connection may accumulate before it gives up.

Formats 1 type, 1 function or constant
TmuxText struct 6 members

Immutable text bytes returned by tmux.

escape_format function

Escape text so tmux uses it as written rather than expanding it.

Queries 9 types, 8 functions and constants
Matcher trait 1 member

A predicate that evaluates a borrowed candidate.

QueryIteratorExt trait 4 members

Cardinality and named-predicate operations for native iterators.

FilterEnum trait 1 member

Stable string semantics for a custom enum filter field.

Filterable trait 1 member

A type with a stable schema that can evaluate portable filter predicates.

ManyRelation struct 3 members

A value-only handle for a to-many relation from From to To.

OneRelation struct 1 member

A value-only handle for a to-one relation from From to To.

A filter target whose portable expression grammar can be described.

FilterSchemaDescriptor struct 3 members

One target and every field its decoder accepts.

FilterValueSchema enum 7 members

The value or relation family behind one filter field.

bool_field function

Construct a boolean handle for generated code.

enum_field function

Construct a custom enum handle for generated code.

filter_schema function

Return generated metadata for one related target.

integer_field function

Construct an integer handle for generated code.

many_relation function

Construct a to-many relation handle for generated code.

one_relation function

Construct a to-one relation handle for generated code.

text_field function

Construct a text handle for generated code.

Construct the source-less generated fallback for an unknown field.

Queries — Fields 6 types
TextField struct 12 members

A typed handle for a portable text field on T.

BoolField struct 3 members

A typed handle for a portable boolean field on T.

A typed handle for a fixed-width integer field N on T.

EnumField struct 3 members

A typed handle for a custom enum field E on T.

FilterFieldSchema struct 1 member

One accepted field and the predicates valid for it.

A field handle whose value a Target snapshot holds.

Queries — Expressions 2 types
FilterExpr struct 4 members

An opaque, portable predicate over candidates of type T.

Predicate struct 14 members

One opaque predicate passed to generated candidate dispatch.

Snapshots 5 types
CapturedLine struct 4 members

One line of a capture, with what tmux knows about it.

CapturePane struct 2 members

Read a pane's contents.

Availability enum 7 members

A snapshot field's value, or the reason the snapshot holds none.

PaneProgressState enum 5 members

Closed progress-state vocabulary tmux emits for a pane's progress bar.

Sealed trait

Keeps super::ReadField implemented by this crate's handles only.

Workspaces 7 types
Effects struct 5 members

What an operation does to tmux state.

Safety enum 3 members

How an operation directly affects tmux objects.

SetOption struct 3 members

Set a tmux option.

SetEnvironment struct 1 member

Set a variable in a session's environment.

SendKeys struct 4 members

Send text or named keys to a pane.

Pause struct 2 members

Wait before the next operation runs.

SelectLayout struct 1 member

Rearrange a window's panes into a named or described layout.

Workspaces — Plans 3 types
Plan struct 10 members

Operations recorded but not yet run.

Planner enum 6 members

How a plan is grouped into tmux invocations.

Compiles the workspace README's examples, and nothing else.

Workspaces — Steps 10 types

An operation that can be recorded in a Plan.

An operation that may share one tmux invocation with its neighbours.

FromStep trait 1 member

Turns a recorded step index into whatever Plan::add() returns for it.

Step struct 5 members

One tmux invocation: the operations it carries, in order.

StepReason enum 5 members

Why a Step is its own tmux invocation.

Outcome enum 5 members

How an operation ended.

Attribution enum 2 members

How much a run could tell about each operation's outcome.

OperationValue enum 5 members

The typed value one operation produced.

OperationReport struct 5 members

What one recorded operation produced, in plan order.

StepOutcome struct 7 members

What one dispatched invocation produced.

Workspaces — Targets and slots 9 types
Scope class 3 members

The tmux object an operation addresses or makes.

Slot struct 3 members

A typed reference to the object a recorded operation will create.

Marker for a slot that points at a session.

WindowSlot struct

Marker for a slot that points at a window.

PaneSlot struct

Marker for a slot that points at a pane.

PaneTarget enum 2 members

A -t target naming a pane, resolved when the plan runs.

WindowTarget enum 2 members

A -t target naming a window, resolved when the plan runs.

SessionTarget enum 2 members

A -t target naming a session, resolved when the plan runs.

SplitTarget enum 2 members

split-window's -t: a window (its active pane divides) or an exact pane. -t <window> always resolves to the active pane, which a detached split never changes, so a chain of splits needs the pane form (SplitWindow::from_pane()) after the first.

Workspaces — Session 1 type
NewSession struct 3 members

Create a session.

Workspaces — Window 5 types
SplitWindow struct 8 members

Split a window, making a pane.

NewWindow struct 7 members

Create a window in a session.

SelectWindow struct 1 member

Make a window the active one.

RenameWindow struct 1 member

Rename a window.

KillWindow struct 2 members

Destroy a window.

Workspaces — Pane 2 types
SelectPane struct 1 member

Make a pane the active one.

KillPane struct 2 members

Destroy a pane.

Errors 12 types
ControlModeErrorKind enum 9 members

Why a control-mode connection failed.

OptionErrorKind enum 3 members

Which way tmux would not accept an option.

ErrorKind enum 10 members

A coarse failure category for reporting and routing.

IdParseError struct 1 member

An invalid scope-specific tmux object ID.

Error enum 50 members

An error returned by libtmux.

ObjectKind enum 4 members

The kind of tmux object a failure refers to.

ListingDecodeError struct 2 members

Payload-free metadata describing why tmux output could not be decoded.

ScopeError enum 7 members

A scoped resource's creation, operation, or cleanup failure.

PlanValidationError struct 5 members

An invalid dependency between two plan steps, or a step whose own arguments cannot render as one tmux command.

ExactlyOneError enum 2 members

The ways an iterator can fail to contain exactly one item.

An error indicating that an iterator contained more than one item.

FilterExpressionError struct 1 member

A source-less, value-free portable expression validation error.

Errors — Server 2 types

The category of an invalid crate::ServerBuilder configuration.

ServerGoneKind enum 4 members

Which way a tmux server was not there.

Errors — Session 1 type
SessionNameError enum 2 members

Why a session name is one tmux could not address.

Constants and enums 15 types
CommandResult struct 13 members

The exact status and output captured for one tmux command.

Event enum 30 members

Something tmux reported that no command asked for.

BlockResult struct 4 members

The outcome of one command sent over control mode.

ControlMode struct 7 members

One control-mode connection to a tmux server.

ReplaceMode enum 2 members

Whether writing a hook keeps the entries it does not name.

OptionKind enum 7 members

What kind of value an option holds.

CaptureOptions struct 9 members

How far back a capture reaches, and in what form.

Why a plan dependency is invalid.

PlanResult struct 5 members

What running a plan produced.

The category of an invalid portable filter expression.

IntegerKind enum 10 members

The fixed-width integer types understood by generated schema checks.

AccessMode enum 2 members

How much a user on the server's access list may do.

PromptKind enum 4 members

Which prompt tmux is remembering answers for.

JoinOptions struct 3 members

Where a pane lands when it is moved into another window.

SplitOptions struct 8 members

Options for splitting a window or pane into a new pane.

Constants and enums — Session 1 type
NewSessionOptions struct 6 members

Options for creating a session.

Constants and enums — Window 1 type
NewWindowOptions struct 9 members

Options for creating a window in a session.

Testing utilities 6 types, 5 functions and constants
TestServerErrorKind enum 10 members

The category of a TestServer lifecycle failure.

TestServerError struct 2 members

A source-less, redacted failure from TestServer.

TestServerBuilder struct 6 members

A consuming builder for an isolated foreground tmux test server.

TestServer struct 8 members

One isolated tmux daemon and its descriptor-relative cleanup guard.

DaemonState enum 4 members

Whether a fixture's tmux daemon is still running, and how it ended if not.

RetryTimeout struct 1 member

A condition did not hold before its deadline.

Write script to path as an executable, and return once it can run.

Kill tmux servers left behind by fixtures that never cleaned up.

retry_until function

Poll until a condition holds, or the deadline passes.

scaled function

Widen a fixture deadline by LIBTMUX_TEST_TIMEOUT_SCALE.

unique_name function

Build a name no other caller in this process will produce.

Internal 5 functions and constants

Frame arbitrary control-mode output into replies, and check each reply.

Decode arbitrary listing output, then check that decoding inverts tmux.

__fuzz_layout function

Exercise layout validation for fuzzing; not a supported API.

Parse one control-mode protocol line, for fuzzing only.

Decode list-keys -F output, for fuzzing only.

Other 8 types
Runtime struct 3 members

A runtime for calling this crate's async methods from ordinary code.

OutputLimits struct 6 members

How many bytes one dispatch may read from each stream.

The design notes, compiled.

Findings struct

The findings catalogue, compiled for the same reason as DesignNotes.

Checks that a doctest runs inside the tmux sandbox.

Compiles the libtmux-macros README's examples, and nothing else.

Readme struct

Compiles the README's Rust blocks. The README is the command's page on crates.io, not this crate's documentation, so it renders nowhere here.

By module 54 modules

Esc

Type to search.

Reference previewOpen reference