Core LibraryunreleasedAPI reference

Choose documentation 3

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.

MoreLess about this notice

API reference

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

116 types, 129 functions, 320 fields and 1 constant.

source libtmux/libtmux-julia@0e761d353bc0
Server 3 types, 4 functions and constants
Server struct 3 members

Describe a tmux endpoint without contacting it. Name at most one socket. A description does not own a daemon or any sessions.

OwnedServer struct 10 members

Own one foreground tmux daemon and its private socket directory. .server is the explicit endpoint. Call close to reap the daemon and remove its directory; use with_server when ownership can follow a callback's lifetime. This handle does not own unrelated processes launched by application code.

ServerIdentity struct 2 members

A captured endpoint and opaque daemon-generation observation, not a strict guard.

open_server function
with_server function
from_env function
kill_server function
Session 1 type, 7 functions and constants
SessionWhere struct 1 member

Match captured SessionSnapshot values without I/O. Omitted keywords are unconstrained. Explicit nothing requires nullable captured absence. All specified fields and related records are checked for coverage first.

sessions function
session function
new_session function

Rename an exact object without expanding format text. tmux's name normalization rules still apply. Return the command result.

kill_session function

Remove the referenced tmux object and return its CommandResult. Identity checks are best effort; strict=true refuses execution. Failures after submission may have remote effects and are never retried.

SessionRef type alias

Identify one tmux session on the daemon generation it was captured from. new_session returns one, and a SessionSnapshot carries its own as .ref. Operations check a reference against the running daemon before acting and raise StaleReference or CrossServerReference when it no longer matches.

SessionID type alias
Window 4 types, 16 functions and constants
WindowLinkRef struct 3 members

Identify one session/index link and its expected physical window. Operations verify that the slot still contains this window before acting. Generation and link checks are best effort; subprocess commands cannot reserve the link.

WindowLink struct 2 members
WindowWhere struct 1 member

Match captured WindowSnapshot values without I/O. Omitted keywords are unconstrained. Explicit nothing requires nullable captured absence. All specified fields and related records are checked for coverage first.

WindowLinkWhere struct 1 member

Match captured WindowLink values without I/O. Omitted keywords are unconstrained. Explicit nothing requires nullable captured absence. All specified fields and related records are checked for coverage first.

windows function
window function
new_window function
split_window function
select_window function
rename_window function

Rename an exact object without expanding format text. tmux's name normalization rules still apply. Return the command result.

resize_window function

Request absolute dimensions in cells; supply at least one dimension. tmux may constrain pane dimensions to fit adjacent panes. Window resizing selects tmux's manual window-size policy. Return the command result.

move_window function
swap_window function

Restart the target's original command, or use explicit command argv or shell_command. Running processes are protected unless kill_running=true. Respawning a window reduces it to one pane; other pane references become stale. For shared windows, tmux chooses the session context used for the process environment. Return the command result without retry or rollback.

kill_window function

Remove the referenced tmux object and return its CommandResult. Identity checks are best effort; strict=true refuses execution. Failures after submission may have remote effects and are never retried.

WindowRef type alias

Identify one physical window on the daemon generation it was captured from, whichever sessions link it; WindowLinkRef names one session's link. new_window returns one, and a WindowSnapshot carries its own as .ref. Operations check a reference against the running daemon before acting and raise StaleReference or CrossServerReference when it no longer matches.

WindowID type alias
Pane 4 types, 18 functions and constants
PaneOccurrence struct 2 members

A physical pane viewed through one captured session/window link.

PaneOutput struct 4 members

Owned, octal-decoded bytes from one exact pane. age_ms retains tmux's optional extended-output age. Chunks are raw output, not screen images, text lines or command-completion evidence.

PaneWhere struct 1 member

Match captured PaneSnapshot values without I/O. Omitted keywords are unconstrained. Explicit nothing requires nullable captured absence. All specified fields and related records are checked for coverage first.

TextDecoder struct 4 members

Create a single-owner incremental UTF-8 decoder. decode! returns complete text and retains at most three copied bytes from an incomplete sequence. invalid=:error throws InvalidUTF8Error; invalid=:replace emits U+FFFD for each maximal subpart described by Unicode 17, section 3.9.6.

panes function
select_pane function
resize_pane function

Request absolute dimensions in cells; supply at least one dimension. tmux may constrain pane dimensions to fit adjacent panes. Window resizing selects tmux's manual window-size policy. Return the command result.

move_pane function
swap_pane function
respawn_pane function

Restart the target's original command, or use explicit command argv or shell_command. Running processes are protected unless kill_running=true. Respawning a window reduces it to one pane; other pane references become stale. For shared windows, tmux chooses the session context used for the process environment. Return the command result without retry or rollback.

kill_pane function

Remove the referenced tmux object and return its CommandResult. Identity checks are best effort; strict=true refuses execution. Failures after submission may have remote effects and are never retried.

PaneRef type alias

Identify one physical pane on the daemon generation it was captured from. split_window returns one, and a PaneSnapshot carries its own as .ref. Operations check a reference against the running daemon before acting and raise StaleReference or CrossServerReference when it no longer matches.

PaneID type alias
break_pane function
decode_text function
decode! function
occurrencekey function
paste_bytes function
paste_text function
pipe_pane function
rotate_panes function
Client 2 types, 4 functions and constants
ClientID struct 2 members

An exact client name and observed connection incarnation; names may be reused.

ClientWhere struct 1 member

Match captured ClientSnapshot values without I/O. Omitted keywords are unconstrained. Explicit nothing requires nullable captured absence. All specified fields and related records are checked for coverage first.

clients function
switch_client function
detach_client function
ClientRef type alias

Identify one attached tmux client by its name and observed connection incarnation, because tmux can reuse client names. A ClientSnapshot carries its own as .ref, and switch_client and detach_client take one. Operations check a reference against the running daemon before acting and raise StaleReference or CrossServerReference when it no longer matches.

Hooks 2 types, 4 functions and constants
HookCommand struct 3 members

One sparse hook entry with tmux's canonical command body and inheritance marker.

HookEntry struct 4 members

A sparse hook row; index=command=nothing records an explicitly empty array.

get_hook function
set_hook function
unset_hook function
list_hooks function
Options 1 type
OptionEntry struct 6 members

A captured option row; an empty array has array=true, index=value=nothing.

Options — Functions 4 functions and constants
get_option function
set_option function
unset_option function
list_options function
Keys and bindings 1 function or constant
send_keys function
Buffers 2 types, 5 functions and constants
BufferID struct 1 member

An exact tmux paste-buffer name.

BufferInfo struct 2 members

A borrowed paste-buffer observation. Listing neither creates nor owns the buffer.

load_buffer function
save_buffer function
delete_buffer function
BufferRef type alias
list_buffers function
Layout and geometry 2 functions and constants
Environment 1 type, 5 functions and constants
EnvironmentValue struct 3 members

A configured environment entry; value=nothing marks removal from new processes.

Delete the configured entry, allowing global inheritance.

Mark the variable for removal from new process environments.

Terminal capabilities 1 type
UnsupportedCapability struct 2 members
Versions 1 type, 1 function or constant
UnsupportedTmuxVersion struct 3 members

Raised when the selected tmux daemon, or the executable that would start one, reports a release below MINIMUM_TMUX_VERSION, when no release can be read, or when the daemon changed after the version check. The refused command had no effect. observed is the reported release, empty when none was established; detail explains refusals that a release number cannot.

Commands 7 types, 7 functions and constants
TmuxCommand struct 1 member

Own one finite command's literal arguments. Construction performs no I/O and does not interpret shell text or semicolon separators. Control execution still requires the transport's audited command grammar.

CancellationToken struct 4 members

An explicit, task-safe cancellation signal. cancel! is idempotent. Cancelling an operation retires its local resources; it does not roll back tmux effects.

CancellationSubscription struct 4 members

An owned cancellation callback registration; close unregisters and joins its callback.

RequestCancelled struct 2 members
DeadlineExceeded struct 3 members
OutputLimitExceeded struct 3 members
TmuxNotFound struct 2 members
run_command function
cancel! function
iscancelled function
on_cancel function
Base.close function
run_batch function
run_group function
Control mode 5 types, 14 functions and constants
ControlConnection struct 30 members

Own a control client attached to a borrowed session. Closing the connection owns client processes, pipes and Julia tasks, never the session or daemon. Attach/detach still invokes configured hooks and can trigger tmux's destroy-unattached/exit-unattached settings. Aliases and hooks are trusted server configuration; they must not replace admitted command semantics.

ObservationBaseline struct 4 members

A screen capture bracketed by reader cursors, with continuity == :reset. bytes owns the capture. before and after bracket acquisition; neither cursor proves an atomic boundary between this screen and raw pane output. Replaying from either cursor must not be used to reconstruct an exact screen.

ControlSignal struct 8 members

A bounded, one-use wait signal whose tmux channel belongs to its connection.

ObservationCursor struct 5 members

A position bound to a server generation, optional pane, connection epoch, event kind and sequence. Obtain it with observation_cursor. Replay validates its scope and retained history; it is not a screen offset or a persistent cursor across connections.

ObservationStream struct 19 members

A single-consumer, bounded event iterator. Use take!(stream; timeout, cancel) for an explicit deadline or for event in stream for connection-lifetime iteration. Close explicitly or use the producer's do-block form for deterministic cleanup. An unreachable stream is retired eventually; GC is not a cleanup deadline. Each fan-out subscriber owns its byte copies; overflow ends only that subscription.

open_control function
notifications function
Base.isopen function
Base.wait function
Base.notify function
Base.eltype function
Base.iterate function
Base.take! function
Formats 5 types, 4 functions and constants
FormatField struct 1 member

Describe one literal tmux format identifier with a String, Int or Bool decoder. Names match [a-z][a-z0-9_]*; any such name is accepted, including variables outside the snapshot field catalog. Construction does not prove that the connected tmux supports the variable or supplies it in a given context. Expressions, option names and command substitutions require RawFormat.

FormatHints struct 4 members

Unverified candidate names from tmux's unescaped format listing. result retains bounded raw command evidence. availability is :unverified and complete is false; candidate names do not prove variable support.

FormatObservation struct 4 members

One explicit format observation. :present means a nonempty expansion, not a version-support guarantee. Empty expansions have availability=:unverified: tmux cannot distinguish an empty value from an unknown or unavailable variable. raw always retains the decoded text. Empty strings retain value=""; numeric and Boolean observations use value=nothing until their value is verified.

FormatUpdate struct 7 members

One sampled format field, with session and window-link context. bytes retains the field codec's escaped value; window_index is tmux's contextual index. Optional window/pane references distinguish session-level updates. Pane values may repeat for multiple links; their context is preserved rather than deduplicated.

RawFormat struct 1 member

An explicit executable tmux format expression. In particular, #() can start shell commands on the tmux host. It is never inferred from a field name or evaluated during construction. tmux controls expansion, job scheduling and cached command-substitution results; rendering does not wait for those jobs.

format_hints function
format_value function
read_formats function
render_format function
Queries 23 types, 19 functions and constants

A validated local predicate; portable criteria never contain caller callbacks.

Filters module

Named local filter operators. Import as import LibTmux.Filters as F.

RowProjection struct 1 member

Read-only scalar rows over one captured selection. Construct with project_rows. Column names and types survive empty selections. Retaining this projection retains its source snapshot. No operation refreshes data.

Selection struct 2 members

Read-only, ordered membership copied from items. Filtering preserves its element type, order, duplicates and snapshot provenance. A small selection may retain its entire snapshot. collect, map and similar return ordinary mutable arrays. Elements supplied by callers are not recursively frozen.

WhereLimits struct 5 members

Bound the complete inert document before constructing predicates. Nodes count objects, arrays, keys and scalars; bytes count UTF-8 strings and keys together. Limits also apply when encoding local criteria. They do not limit later graph traversal, which depends on the supplied snapshot.

WireObject struct 1 member

An inert object retaining key pairs, including duplicates, until validation. External codecs must preserve duplicate keys or reject them during parsing. An ordinary Dict cannot reveal keys discarded before decode_where runs.

AllOf struct 1 member
AllRelated struct 1 member
AnyOf struct 1 member
AnyRelated struct 1 member
AtLeast struct 1 member
AtMost struct 1 member
Contains struct 2 members
EndsWith struct 2 members
EqualTo struct 1 member
GreaterThan struct 1 member
LessThan struct 1 member
NoRelated struct 1 member
Not struct 1 member
NotEqualTo struct 1 member
OneOf struct 1 member

Membership in a copied, immutable tuple of scalar operands.

Related class
StartsWith struct 2 members
Base.filter function
Base.getindex function
Base.similar function
Base.size function
decode_where function
encode_where function
onlymatch function
project_rows function

Read criteria JSON after using JSON loads the optional codec extension. Input byte, nesting and token bounds are checked before JSON materialization; duplicate keys and invalid JSON raise WireCriteriaError.

Tables.rows function
Tables.schema function

Write criteria JSON after using JSON loads the optional codec extension.

Queries — Operators 1 type
Operator class
Snapshots 7 types, 7 functions and constants
Snapshot struct 16 members

Privately owned captured records and membership coverage. Acquiring a new snapshot never refreshes an existing one. Its acquisition interval describes process-relative monotonic seconds, not UTC or a tmux transaction. Obtain collections with panes, windows, sessions, clients, windowlinks, and paneoccurrences.

SessionSnapshot struct 2 members
WindowSnapshot struct 2 members
PaneSnapshot struct 2 members
ClientSnapshot struct 2 members
InconsistentSnapshot struct 1 member

The supertype of the rows a Snapshot holds: sessions, windows, panes, clients and window links. Each row reads from the snapshot it came from.

snapshot function
capture_pane function
capture_bytes function
hascoverage function
snapshotof function
Errors 21 types, 1 function or constant
CaptureDecodeError struct 2 members

A capture decoding failure with its cause and an owned copy of source bytes.

CommandError struct 2 members
ControlBufferCleanupError struct 2 members

An owned control buffer could not be retired; buffer identifies the possible remote resource.

ControlCleanupError struct 1 member

Owned resource cleanup or retirement of submitted backend work was not proved.

ControlCommandError struct 2 members

An admitted control command failed; result retains its owned reply bytes and guard.

ControlConnectionError struct 2 members

A terminal control-lane failure; sent distinguishes possible remote effects from non-submission.

ControlTargetError struct 1 member

An exact control target did not resolve; no fallback observation is returned.

CreationResponseError struct 3 members

A creation command completed, but its reply could not establish the result. result retains the command output and exit evidence; cause explains the invalid reply or changed identity. sent is always true: remote effects may have occurred. The library neither retries creation nor removes its results.

CrossServerReference struct 1 member
FormatValueError struct 4 members

A nonempty format value failed its requested decoder; command bytes remain in result.

InvalidUTF8Error struct 2 members

Malformed UTF-8 at the one-based byte offset of a stream subsequence.

MultipleMatchesError struct 1 member

An exact-cardinality criterion matched at least two items; the remaining source may not be counted.

NoMatchError struct 1 member

An exact-cardinality criterion matched no items in its source.

ObservationLost struct 2 members

An observation gap or invalid replay position; cursor is the last accepted position.

ProcessIOError struct 3 members
ProcessSpawnError struct 2 members
SnapshotCoverageError struct 3 members

Captured data cannot answer a requested field or relation; this is not a no-match result.

StaleReference struct 1 member
UnsupportedCriterion struct 3 members

A criterion outside a named sibling profile's verified portable subset.

WireCriteriaError struct 3 members

A criteria document error with a stable code and structural location.

Errors — Server 2 types
OwnedServerCleanupError struct 3 members

Cleanup finished with forced termination, incomplete diagnostics, or lost directory ownership.

OwnedServerStartError struct 4 members

Startup failed after the owned daemon was spawned; result retains its exit evidence.

Constants and enums 10 types
BatchResult struct 1 member

An ordered, read-only finite collection of independently executed command outcomes.

CommandResult struct 4 members

Owned output bytes and exit evidence from one completed tmux client.

ControlResult struct 5 members

Owned reply bytes and guard for an admitted control command. run_command returns after its completion fence; grouped outcomes expose completion separately when cancellation leaves only a partial response.

GroupResult struct 5 members

An explicit semicolon group's outcomes and aggregate response. retired means its completion fence was observed. opaque means the transport could not attribute the aggregate response to individual commands. A group is not a transaction; successful effects before an error remain applied.

NotificationEvent struct 3 members

A known tmux notification. name is its protocol name as a symbol; bytes owns the complete record without its final LF. No UTF-8 conversion is implied.

A notification, raw pane-output chunk or sampled format value with an observation cursor.

OperationResult struct 7 members

One input-indexed outcome. status is :completed, :failed, :skipped, or :unknown. acknowledged records a response; completed records queue completion for an audited synchronous command. result and error retain the evidence. Background application work is never inferred complete.

OutputWaitResult struct 8 members

One accepted output observation. text is a bounded UTF-8 tail; dropped_bytes counts complete decoded bytes omitted from this result and pending_bytes counts an incomplete UTF-8 suffix retained by the decoder. received_bytes counts raw bytes consumed by this wait. Tail truncation is local retention policy; an actual stream gap instead raises ObservationLost, and a pane or server that ended raises OutputWaitEnded with the text so far. The cursor covers the whole last consumed event, including omitted bytes; it cannot resume within a matched event.

ScreenWaitResult struct 4 members

One accepted screen wait. text is the screen of the matching read, cut to a tail of at most max_bytes bytes, and dropped_bytes counts the bytes cut from its head. When max_bytes cuts the screen, the match can lie in the dropped head, so text need not contain it. matched_at_entry is true exactly when the match was on the entry read, and then source == :baseline; otherwise source == :output.

The read-only vector of OperationResult values that BatchResult and GroupResult share: index, iterate and measure either one like a Vector{OperationResult}.

Other 7 types, 15 functions and constants
EntityID class

The supertype of every tmux entity ID: TmuxID and ClientID.

EntityRef struct 2 members

A typed entity identity bound to a captured daemon generation.

OutputWaitEnded struct 3 members

A wait that ended because the pane or the tmux server is gone. reason is :pane_exited or :server_exited; text is the output the wait had seen and cursor the last accepted position. Unlike ObservationLost, nothing is left to observe, so a new baseline cannot help.

ScreenWaitEnded struct 2 members

A screen wait that ended because the pane or the tmux server is gone. reason is :pane_exited (the pane is dead, or tmux no longer knows it) or :server_exited; text is the last screen the wait read, cut to the wait's max_bytes. OutputWaitEnded is the counterpart for stream waits.

ScreenWatch struct 11 members

The handle watch_screen passes to its block. It holds the entry screen, the polling interval and the total deadline. It is valid only inside the block. Every wait on it counts against the entry read taken when the block opened, so a second wait for the same text returns at once.

TmuxID struct 1 member

A validated tmux numeric ID whose type fixes its entity kind.

LibTmux module
Base.== function
Base.get function
Base.hash function
Base.isequal function
Base.show function
Base.string function
clear_history function
entitykey function
set_title function
set_zoom function
wait_for function
wait_for_text function
watch_screen function

By module 5 modules

Esc
Search in

Type to search.

Reference previewOpen reference