925 symbols, extracted from source. Every type name in a signature links to its own entry; every cross-reference in a doc comment resolves against the same table.
By module 21 modules
-
common 26
- Command
Options - Command
Outcome - Command
Result - Logical
Ref Base - Tmux
Invocation Report - is
Safe Integer - safe
Integer - Connection
Alias - Daemon
Epoch - Delivery
Status - Logical
Ref - Operation
Status - Pane
Id - Pane
Id Input - Pane
Ref - Safe
Integer - Session
Id - Session
Id Input - Session
Ref - Tmux
Id - Tmux
Id Input - Tmux
Id Kind - Tmux
Invocation Observer - Window
Id - Window
Id Input - Window
Ref
- Command
-
errors 22
- Lib
Tmux Error - Multiple
Matches Error - Multiple
Objects Error - No
Match Error - Object
Not Found Error - Query
Validation Error - Tmux
Command Error - Tmux
Object Not Found Error - Tmux
Server Restarted Error - Tmux
Transport Error - Version
Too Low Error - Wait
Timeout Error - Exception
Options - Multiple
Objects Error Options - Object
Not Found Options - Tmux
Command Failure Options - Tmux
Transport Error Options - Lib
Tmux Error Code - Query
- Query
Validation Error Code - Query
Validation Reason - Tmux
Transport Error Kind
- Lib
-
ownership 4
-
selection 22
- Client
Where - Pane
Where - Regex
Criteria Data - Selection
- Session
Where - Window
Where - compile
Bounded Regex - decode
Where Document - encode
Where Document - parse
Legacy Where - Many
Relation - Model
Kind Of - Non
Zero Digit - One
Relation - Raw
Flag - Raw
Number - Scalar
Criteria - String
Filter - String
Filter Fields - Where
Document V1 - Where
For Kind - Where
Of
- Client
-
server 3
-
session 3
-
types 66
- Abort
Like - Capture
Options - Choose
Tree Options - Cmd
Options - Connected
Server - Connection
Options - Format
Subscription - If
Shell Options - Join
Options - Menu
Entry - Move
Window Options - New
Session Options - New
Window Options - Planned
Operation - Popup
Options - Resize
Options - Resize
Window Options - Respawn
Options - Run
Shell Options - Save
Buffer Options - Send
Keys Options - Server
Snapshot - Set
Environment Options - Set
Hook Options - Set
Option Options - Snapshot
Options - Split
Options - Tmux
Client Detached Event - Tmux
Client Session Changed Event - Tmux
Event Stream - Tmux
Exit Event - Tmux
Layout Change Event - Tmux
Message Event - Tmux
Output Event - Tmux
Pane Flow Event - Tmux
Pane Mode Changed Event - Tmux
Paste Buffer Event - Tmux
Reconnected Event - Tmux
Reconnecting Event - Tmux
Session Event - Tmux
Sessions Changed Event - Tmux
Session Window Changed Event - Tmux
Subscription Event - Tmux
Unknown Event - Tmux
Version - Tmux
Window Lifecycle Event - Tmux
Window Pane Changed Event - Tmux
Window Renamed Event - Wait
For Options - Watch
Options - is
Split Size - is
Tmux Name - split
Size - Connect
Options - Digit
- Environment
Scope - Environment
Value - Hook
Scope - Menu
Item - Non
Zero Digit - Split
Cell Size - Split
Percentage - Split
Size - Tmux
Event - Window
Target - Zero
To Ninety Nine
- Abort
-
window 3
-
mcp.startup 3
Server 2 types, 2 functions and constants
One tmux server, addressed by the socket it listens on.
A server with a persistent observation connection and daemon-lifetime tracking.
-
Which run of the daemon a handle came from, counted from zero.
A restarted tmux on the same socket issues
%0again to a different pane, so an id from the previous run names nothing. Comparing epochs is what catches that, and it is whySessionRefand friends carry one.
-
Which tmux daemon answered, as tmux itself reports it.
A socket path names a place, not a process:
kill-serverand a restart give a new daemon the same path, and that daemon numbers its panes from%0again. The pid alone is not enough — pids are reused — so the start time goes with it.
Session 2 types, 5 functions and constants
Criteria matching a session, evaluated against one snapshot.
One session on one tmux server, as a handle rather than a copy of it.
-
The readable name this library gives each session format field.
A handle exposes both spellings: the alias, and tmux's own token through
format. The alias is this library's, so a field with no entry here is reachable only by its tmux name.
-
A session ID in tmux's
$nform.
-
Raw session-ID text or an authenticated session ID.
-
One session, named unambiguously across servers and daemon restarts.
-
The tmux format fields a session handle is built from, by tmux's own names.
Read through
formatwhen the aliased property names on the handle are not what a caller wants — a field tmux added in a later version has a token here whether or not this library has given it a name.
Window 3 types, 7 functions and constants
Criteria matching a window, evaluated against one snapshot.
One window on one tmux server, as a handle rather than a copy of it.
What applying one window needs to know beyond the window itself.
-
The readable name this library gives each window format field.
A handle exposes both spellings: the alias, and tmux's own token through
format. The alias is this library's, so a field with no entry here is reachable only by its tmux name.
-
Where a new window lands relative to the one it was created from.
tmux inserts at the next index before or after the target and moves the windows above it up to make room, so indices a caller is holding can shift. Without either direction the target index *is* the new window's place.
-
A window ID in tmux's
@nform.
-
Raw window-ID text or an authenticated window ID.
-
One window, named unambiguously across servers and daemon restarts.
-
The tmux format fields a window handle is built from, by tmux's own names.
Read through
formatwhen the aliased property names on the handle are not what a caller wants — a field tmux added in a later version has a token here whether or not this library has given it a name.
-
A relative direction, or any window target tmux accepts.
The intersection keeps the three literals in autocomplete instead of letting the bare
stringswallow them.
Pane 2 types, 6 functions and constants
One pane on one tmux server, as a handle rather than a copy of it.
Criteria matching a pane, evaluated against one snapshot.
-
The readable name this library gives each pane format field.
A handle exposes both spellings: the alias, and tmux's own token through
format. The alias is this library's, so a field with no entry here is reachable only by its tmux name.
-
Which side of the current pane a split puts the new one on.
AboveandLeftare the same split asBelowandRightwith tmux's-bflag, so the geometry is identical and only the occupant differs.
-
A pane ID in tmux's
%nform.
-
Raw pane-ID text or an authenticated pane ID.
-
One pane, named unambiguously across servers and daemon restarts.
-
The tmux format fields a pane handle is built from, by tmux's own names.
Read through
formatwhen the aliased property names on the handle are not what a caller wants — a field tmux added in a later version has a token here whether or not this library has given it a name.
Client 2 types, 2 functions and constants
One client attached to a tmux server, as a handle rather than a copy of it.
Criteria matching a client, evaluated against one snapshot.
-
The readable name this library gives each client format field.
A handle exposes both spellings: the alias, and tmux's own token through
format. The alias is this library's, so a field with no entry here is reachable only by its tmux name.
-
The tmux format fields a client handle is built from, by tmux's own names.
Read through
formatwhen the aliased property names on the handle are not what a caller wants — a field tmux added in a later version has a token here whether or not this library has given it a name.
Hooks 1 function or constant
Options 2 functions and constants
-
"Whatever scope tmux would use", as a value rather than an absent argument.
Branded so it cannot be confused with an
OptionScope: passing this means the call sends no scope flag, which is not the same as sending the session one.
-
Which table an option is read from or written to.
The scopes are not one chain. A pane option falls back to the window's, and an unset window or pane option falls back to the global window options; a session option falls back to the global session options, and server options belong to no session, window or pane at all. So setting something at window scope reaches every pane in it that has not set its own, and setting it at session scope does not.
Layout and geometry 6 functions and constants
-
Which edge a resize moves, in tmux's own terms.
The direction is where the boundary travels, not which pane grows:
Upon a pane with a neighbour above it takes space from that neighbour.
-
A nonnegative cell count within tmux's signed 32-bit geometry range.
Examples
import { splitSize } from "libtmux";import type { SplitCellSize } from "libtmux";const size: SplitCellSize = splitSize(20);
-
A canonical whole percentage from
0%through100%.Examples
import type { SplitPercentage } from "libtmux";const size: SplitPercentage = "30%";void size;
-
An authenticated cell count or canonical percentage for a pane split.
Examples
import type { SplitSize } from "libtmux";const size: SplitSize = "30%";void size;
-
Test whether a value is valid tmux split geometry.
Examples
import { isSplitSize } from "libtmux";const value: unknown = "30%";const size = isSplitSize(value) ? value : undefined;
- splitSize ( value : : number ) SplitCellSize ( value : : SplitPercentage ) SplitPercentage ( value : : SplitSize ) SplitSize ( value : : number | string ) SplitSize
-
Authenticate tmux split geometry or throw.
Examples
import { splitSize } from "libtmux";const size = splitSize(20);
Environment 2 functions and constants
-
Environments live at server (global) or session scope, as hooks do.
-
A variable's state in a tmux environment.
nullis tmux's-NAME: the variable is present and marked for removal from the environment of any process tmux starts. Absent from the map is the third state, and means tmux carries no entry at all.
Versions 1 type
The tmux version a server is running.
Commands 1 type, 4 functions and constants
One command's result together with how far it got.
-
Which connection a handle came through.
Two servers on different sockets number their objects from the same place, so an id alone does not identify anything. This is the other half.
-
Making a command refuse to run on a daemon that is not the one it was read from.
A tmux id is unique within one daemon and reissued by the next:
kill-serverand a restart give a new daemon the same socket, and it numbers its panes from%0again. A handle captured before the restart therefore names something that exists, belongs to somebody else, and answers to the same command.Checking first and sending second does not close that: the daemon can change between the two.
if-shell -Fdoes, because it is not a shell — tmux expands the format inside its command queue andcmdq_insert_afters the guarded command into the same queue, so nothing runs in between. The condition ispidandstart_timetogether, since pids are reused.The refusal has to be visible. tmux answers a false condition with no output and status 0, which is indistinguishable from a command that printed nothing, so the else branch is a freshly named unknown command. A 128-bit suffix makes matching a pre-existing command alias a guess, and the exact diagnostic distinguishes the refusal from the guarded command failing. The guarded command keeps its own stdout and stderr either way.
-
One nonempty tmux command, before command-list separators are inserted.
-
What runs a tmux command for a server.
Two obligations beyond returning bytes, and both are what the layers above assume rather than check:
Every request is one tmux invocation and carries its ordered command list. Keeping that structure at the seam prevents an engine from splitting a snapshot into several clients or guessing where global flags end. Environment, stdin, signal, and timeout apply once to the whole invocation.
daemonGuard, when a request carries one, must reach tmux — or the engine must be bound to one daemon for its lifetime, the way a control connection is. Ignoring it on a reconnecting engine means a handle read before a restart addressing whatever now holds its id.guardRequestis what the built-in engine calls to honour it, published so an implementer does not reproduce the wrapper, its else branch, and the stderr that tells refusal from failure.
Formats 1 type, 7 functions and constants
A format tmux expands and reports whenever its value changes.
-
What a caller reads for one field, once the text has been decoded.
-
Every format field this tmux vocabulary knows, by tmux's own token.
Read from tmux's
format.crather than written by hand, so a field a newer tmux added is here as soon as the vocabulary is regenerated.
-
The three shapes that name a tmux object rather than describe one.
A field of one of these types carries an id a handle can be rebuilt from, which is why the row types refuse to report them as empty.
-
Which kind of object a format field describes.
A field belongs to exactly one scope, and asking a pane for a session's field is what
#{}silently answers as empty rather than as an error.
-
The shapes tmux writes that are not simply text.
-
Which fields carry which shape.
Derived from tmux's own format.c and held to a live server by tests/integration/format_types.test.ts on every version CI runs.
Local:
DecodedFormatValueis what a caller needs.
-
The raw text tmux writes, authenticated where it carries an identity.
Queries 1 type, 14 functions and constants
A pattern and its flags, kept apart from any regular-expression object.
-
How criteria apply to a collection: to any of it, all of it, or none.
At least one of the three must be given.
everyandnoneboth hold vacuously for an empty collection, which is set theory rather than a bug, andsomeis what a caller usually wants instead.
-
Which of the four criteria shapes a handle type is matched with.
-
A leading digit, which tmux never writes as
0in a multi-digit number.
-
How criteria apply to a single related object, which may be absent.
nullmatches the absence itself — a pane whose window is no longer in the snapshot — rather than matching anything.
-
The text tmux sends for a flag: it writes these two and nothing else.
-
The decimal text tmux sends for a field it reports as a number or timestamp.
-
One field's criteria: a value to equal, or a filter describing how to compare.
The bare value is shorthand for
{ equals: value }, andnullmatches a field tmux reports as unset rather than empty.
-
A text comparison, of which exactly one form must be given.
Written as a union so the type rejects
{}— criteria that constrain nothing would match everything, which is never what a caller meant.
-
Criteria as a portable document: which model, which version, and the criteria themselves.
The version is in the payload because these cross a process boundary — an MCP client, a config file — where the reader's library may be older than the writer's. Nothing widens
1in place; a new shape gets a new number.
-
The criteria a selection of this handle type accepts.
Written in terms of the handle rather than the kind so a caller holding a `Selection<Pane>` gets pane criteria without naming the kind twice.
-
Compile a regex under the deterministic selection-query work budget.
- decodeWhereDocument ( input : : unknown ) WhereDocumentV1
-
Validate a WHERE document and restore camelCase criteria names.
The returned document is canonical and deeply frozen.
Examples
import { decodeWhereDocument } from "libtmux/selection";const document = decodeWhereDocument(JSON.parse('{"model":"pane","version":1,"where":{"pane_title":"logs"}}'),);if (document.model === "pane") snapshot.panes.where(document.where);- Raises
-
-
QueryValidationError – when the document or its criteria are invalid.
-
Discussed in Filtering and queries
- encodeWhereDocument ( document : : WhereDocumentV1 ) string
-
Serialize a WHERE document as canonical JSON.
Field names and values use tmux's stable wire spellings. The input is validated without invoking accessors or conversion hooks.
Examples
import { encodeWhereDocument } from "libtmux";const encoded = encodeWhereDocument({model: "pane",version: 1,where: { title: { contains: "log" } },});- Raises
-
-
QueryValidationError – when the document or its criteria are invalid.
-
Discussed in Filtering and queries
- parseLegacyWhere ( model : : Model , input : : unknown ) Extract<WhereDocumentV1, { readonly model: Model }>
-
Convert the Python port's
name__containsspelling to canonical criteria.Accepts one own data property on a plain object and never invokes accessors or conversion hooks. The returned document and its criteria are frozen.
Examples
import { parseLegacyWhere } from "libtmux/selection";const document = parseLegacyWhere("window", { name__contains: "log" });snapshot.windows.where(document.where);- Raises
-
-
QueryValidationError – when the model is not
sessionorwindow, or the input is not exactly one string-valuedname__containsproperty.
-
Queries — Fields 2 functions and constants
-
Idiomatic property names layered over a row, carrying decoded values.
-
A field's criteria accept its decoded shape as well as the text tmux sends:
where({ active: true })andwhere({ active: "1" })are the same query, and serialize identically. Anullcriterion matches any wire value that the field decoder treats as absent or invalid, rather than one particular wire spelling.The text side exists because the wire does.
encodeFormatValuelowers every criterion to tmux's text before a query is serialized, andWhereDocumentV1types both what a caller writes and whatdecodeWhereDocumentgives back — so a type that refused text would be lying about the documents this library's own encoder produces. That is the difference from an ORM, whose query AST never round-trips through a type the caller also authors.Rawis therefore not a taste."0" | "1"is the exact wire domain for a flag, while an integer uses${bigint}intersected with a decimal prefix. That rules out fractions, exponents, radix prefixes, leading zeroes,-0,NaN, and prose. TypeScript cannot bound an integer's magnitude, so the query validator also requires safe range at runtime.format_values.test.tsholds the layers in step.The substring operations stay
stringdeliberately:containsasks about the characters tmux sent, and a numeric field's text has characters like any other.
Snapshots 1 type
An immutable view of the server at one instant.
Workspaces 2 functions and constants
-
When a pane's
shell_commandentries are sent to it.create-only, the default, sends them only to panes this apply created.alwayssends them to every pane on every apply.
-
What to do with windows and panes the workspace does not describe.
Workspaces — Plans 11 types, 17 functions and constants
What Pane.plan offers, one entry per mutation it can describe.
What Session.plan offers, one entry per mutation it can describe.
A tmux command that has been described but not run.
What Window.plan offers, one entry per mutation it can describe.
One existing window placement named by a workspace plan.
A window that applying would create.
Panes that applying would create in one window position.
Existing panes that applying would destroy.
How applying would remove an existing window placement.
One existing window rename, identified independently of its current name.
Session, window, and pane membership changes an apply would make.
-
A validated workspace with every schema default and transform applied.
In other ports Describe a workspace as data
- Python tmuxp uses configuration dictionaries rather than a dedicated workspace value type
- Rust
config.Workspace - Go
workspace.Workspace - Java
io.github.libtmux.workspace.Workspace.Workspace - .NET
LibTmux.Workspace.WorkspaceFile - C++
libtmux::workspace::Workspace - Swift
Workspace
-
A high-level apply operation that finished before a later one failed.
-
The high-level operation an apply was attempting when it failed.
-
Workspace data before schema defaults and transforms are applied.
-
A value tmux stores for a session or window option.
-
A pane: a bare command string, or the settings the pane is created with.
-
Surplus topology retained because removing it would exceed the policy.
-
A window with every schema default applied.
-
A window as written, before
panesdefaults to one implicit pane.
- applyWorkspace ( server : : Server , workspaceInput : : WorkspaceInput , options : : ApplyWorkspaceOptions = {} ) Promise<Session>
-
Build a workspace into a real tmux session, or reconcile one that exists.
tmux gives every new session a window and every new window a pane, so the first window and first pane of each level are adopted rather than created. Creating them anyway is the classic workspace-builder bug that leaves an empty leading window behind.
What this reconciles is *topology*: which windows exist, in what order, under what names, with how many panes, under which layout. It is safe to apply twice and the second run does not duplicate anything. It is deliberately not a process supervisor — see
CommandPolicy— and it does not unset options a previous version of the file had set, because tmux cannot say which of an option's current values this file is responsible for.- Raises
-
-
ZodError – when the workspace does not satisfy the strict config schema.
-
TypeError – when the operation options are invalid.
-
WorkspaceApplyError – when tmux fails after applying may have started.
-
Discussed in Workspaces · Build a workspace from a file · TypeScript workspace internals , TypeScript workspace builder API
In other ports Build a session from a workspace description
- Python
tmuxp.workspace.builder.ClassicWorkspaceBuilder.build - Rust
src.WorkspaceBuilder.build - Go
workspace.Build - Java
io.github.libtmux.workspace.WorkspaceBuilder.WorkspaceBuilder.build - .NET
LibTmux.Workspace.WorkspaceBuilder.BuildAsync - C++
libtmux::workspace::build - Swift
WorkspaceBuilder.build(_:on:)
- normalizeApplyWorkspaceOptions ( options : : ApplyWorkspaceOptions ) { readonly commands: CommandPolicy; readonly prune: PrunePolicy; }
-
Validate and snapshot apply options before server access.
- normalizePlanWorkspaceOptions ( options : : PlanWorkspaceOptions ) PrunePolicy
-
Validate and snapshot planning options before server access.
-
-
Whether this session carries the mark for
name.
-
Validate a parsed workspace, rejecting anything the schema does not allow.
Discussed in TypeScript workspace internals , Use the TypeScript workspace builder , TypeScript workspace builder API
-
Parse a YAML or JSON workspace, then validate it.
YAML parsing is Bun's, and this package otherwise runs anywhere — so this is the one function that does not. Reached from Node it says so, rather than failing on an undefined global; parse the document yourself and hand the result to
parseWorkspace.Discussed in Use the TypeScript workspace builder , TypeScript workspace builder API
- planWorkspace ( server : : Server , workspaceInput : : WorkspaceInput , options : : PlanWorkspaceOptions = {} ) Promise<WorkspacePlan>
-
Plan session, window, and pane membership without changing tmux.
Reads the server once and answers from that capture, so it costs one snapshot and changes nothing. It reports structural creation, removal, retention, and window renames. It does not predict options, layouts, focus, or pane command effects.
Examples
const plan = await planWorkspace(server, workspace);if (plan.removesWindows.length > 0) console.log("would remove", plan.removesWindows);- Raises
-
-
ZodError – when the workspace does not satisfy the strict config schema.
-
TypeError – when planning options are invalid.
-
Discussed in TypeScript workspace internals , Use the TypeScript workspace builder , TypeScript workspace builder behavior , TypeScript workspace builder API
- planWorkspace ( server : : Server , workspace : : Workspace , prune : : PrunePolicy ) Promise<WorkspacePlan>
Workspaces — Session 2 functions and constants
-
Claim a session this apply created.
-
-
The session this workspace names, on a server that may not be running yet.
Acquisition raises on an unreachable server rather than reading as empty, which is the answer a caller asking what is there needs. Building from nothing is the ordinary starting point here, though, and a socket with no daemon behind it is holding this session in the way an empty server is: not at all.
Workspaces — Functions 7 functions and constants
- mayPrune ( policy : : PrunePolicy , owned : : boolean ) boolean
-
Whether surplus topology may be removed.
ownedis the default because it is the only one that is safe without knowing where the session came from: a workspace prunes what it built and leaves alone what it merely found.alwaysauthorizes pruning for one operation; it does not stamp or otherwise adopt the session.
- optionValue ( value : : WorkspaceOptionValue ) string
-
Convert a YAML scalar to the string tmux accepts for an option value.
- paneCommands ( pane : : WorkspacePane , window : : WorkspaceWindow ) readonly string[]
-
Normalize a pane entry to the commands it should run, in order.
A window's
shell_command_beforeruns in every one of its panes, ahead of that pane's own commands, which is how tmuxp seeds a common environment.
- paneStartDirectory ( pane : : WorkspacePane , window : : WorkspaceWindow , workspace : : Workspace ) string | undefined
-
A pane's start directory, falling back to its window's and then the session's.
- paneWantsFocus ( pane : : WorkspacePane ) boolean
-
Whether a pane entry asked to be the focused one.
- windowStartDirectory ( window : : WorkspaceWindow , workspace : : Workspace ) string | undefined
-
A window's directory, inherited from its workspace when it has none.
Requests 2 functions and constants
-
A daemon-guarded request paired with its exact refusal detector.
-
What an engine is asked to run: one ordered command list, and the daemon it must still be talking to.
tmux runs a command list until one fails and discards the rest, so the list is the unit of atomicity a caller gets. The daemon guard is what stops a raw tmux id being applied to whatever a restarted server reissued it to.
Errors 17 types, 5 functions and constants
What any of these errors accepts: the cause, and the tmux command that ran.
The criteria that found nothing, and an optional message replacing the built one.
The criteria that matched too much, with how many it matched when known.
What a failed tmux invocation reported, before it is turned into a message.
The base of every error this library raises.
A command did not complete, and this is how far it got.
What the transport observed when a command did not come back.
A lookup that required one object found none.
A lookup that required one object found several.
A tmux object named by id was not in the list tmux returned.
A field the server is too old to have.
A wait reached its deadline with the condition still unmet.
A selection that required exactly one match found none.
A selection that required exactly one match found several.
Criteria that could not be evaluated, rejected before any command ran.
A tmux command that exited non-zero.
Applying stopped after tmux may already have changed.
-
Every value
LibTmuxError.codecan hold.A union rather than
stringso a comparison against a name this package does not have is a type error rather than a branch that never runs.Each class declares this type rather than its own literal because the hierarchy is three deep in places —
NoMatchErrorextendsObjectNotFoundError— and a literal on the parent makes the child's declaration an illegal override.instanceofis the narrowing tool; this is the one that survives a bundler and a serialization round trip.
-
The criteria a lookup was given, carried on the error it raised.
Kept as the caller wrote it rather than as a formatted sentence, so a caller that built the criteria from a form or a config file can point at the field that was wrong. The message renders it; this is the source.
-
Which half of a lookup was malformed: the id, or the criteria around it.
-
What went wrong between this process and tmux, as opposed to inside tmux.
Errors — Server 1 type
A handle outlived the daemon that issued its id.
Constants and enums 32 types, 5 functions and constants
What every command accepts, whichever handle it is called on.
A finished tmux invocation, as the process left it.
Options for Server.snapshot .
Which side the new pane takes, how big it is, and what runs in it.
How the keys are interpreted before tmux delivers them.
Options for Server.cmd and the handle-level cmd.
Options for joining a pane into another window.
Options for writing a tmux option.
Which part of a pane is read, and in what form.
Which hook table the binding is written to, and whether it replaces or adds.
How far a pane boundary moves, and in which direction.
Where the shell command runs, and whether the call waits for it.
How the condition is decided: by running it, or by expanding it.
Whether a pane whose process is still alive may be restarted.
Size, placement and lifetime of a popup, which floats over the window rather than taking space from it.
What the interactive chooser shows and what selecting a row runs.
Options for writing a tmux environment variable.
A pane produced output.
A subscribed format expanded to a new value.
A window's layout changed.
A paste buffer was written or deleted.
tmux reported a message, or an error in its configuration.
The control-mode connection is ending.
A notification this version of the package does not model.
The connection dropped and was reopened.
The connection dropped and a replacement is being opened.
Options shared by connected servers and event observers.
Timing for a whole-server state wait.
Options for Server.watch , a notification-only observer.
How applyWorkspace should treat a workspace that is already running.
Structural planning options; pane command delivery is apply-only.
-
Options for
Server.connect.
-
What an engine reports back: the process's own exit, not tmux's opinion of it.
A
returncodeof zero and asignalofnulltogether mean tmux ran and answered; either one set means it did not finish, andstderrsays why.
-
Anything a control-mode connection can deliver, as one discriminated union.
tmux pushes these; nothing here asked for them, and they arrive interleaved with command replies. The union is open in practice — an unrecognised notification arrives as
TmuxUnknownEventrather than being dropped, so aswitchshould still have a default.
-
Which of tmux's three id spaces an id belongs to.
The three are numbered independently, so
$1,@1and%1can all exist at once and name unrelated objects. The kind is what keeps a pane id from being passed where a window id belongs.
-
The criteria shape belonging to one model kind.
Constants and enums — Server 1 type
How to reach a tmux server, and what to assume when it is quiet.
Constants and enums — Session 5 types
What a new session starts as, and what it is grouped with.
The attached session changed, or a session was renamed.
The set of sessions changed. Carries no payload; re-read the server.
A session's active window changed.
Another client switched sessions.
Constants and enums — Window 6 types
Where a new window lands, and what runs in it.
Where a window is moved to, and what happens if something is already there.
How far a window's own size moves, or what it is set to outright.
A window was added, closed, or linked into or out of a session.
A window was renamed.
The active pane of a window changed.
Constants and enums — Pane 2 types
A pane entered or left a mode such as copy mode.
tmux paused or resumed output for a pane that fell behind.
Constants and enums — Client 1 type
Another client detached.
Testing utilities 5 types, 3 functions and constants
What every recorded entry carries, answered or not.
One invocation and what tmux answered, as JSON.
One invocation that raised instead of answering.
One invocation that failed, and how.
Every invocation one run made, in order.
-
One entry: either an answer or a failure, never both.
A failure is written down rather than dropped because the queue is positional. An omitted failure does not merely lose itself — it hands the next call the answer belonging to the one after it, so a recorded failure replays as a pass and everything past it is off by one.
- recordInvocations ( inner : : TmuxEngine = new NodeSpawnTransport() ) { readonly engine: TmuxEngine; /** The recording so far, safe to serialize at any point. */ readonly recording: () => TmuxRecording; }
-
Wrap an engine so every invocation it runs is written down.
The wrapper is transparent: it answers exactly what the inner engine answered, so a suite can record while it runs against real tmux and keep asserting on the real results. Called with nothing it wraps the engine a
Serverbuilds for itself, which is what recording against a local tmux means and saves reaching for an internal class to say so.
- replayInvocations ( recording : : TmuxRecording ) TmuxEngine
-
An engine that answers from a recording and never starts a process.
Repeated identical commands answer in the order they were recorded, because two snapshots of a changing server are the same argv and different answers. An argv the recording does not hold raises rather than inventing a result: a test whose code took a path the recording never saw should say so, not quietly pass against an empty server.
Other 6 types, 15 functions and constants
What one tmux invocation cost and how it ended.
The three parts that together name one tmux object for certain.
An immutable, ordered set of tmux objects read at one instant.
One selectable line of a menu: its label, its shortcut, and what it runs.
The part of AbortSignal this package uses.
A live stream of tmux control-mode events.
-
How far a command got before something interrupted it.
This is what a caller needs to decide whether retrying is safe: a command that was never written changed nothing, and one that was written but not answered may have done its work already.
indeterminateis the honest answer, not a missing one.
-
One decimal character, for building a percentage's shape in the type system.
These three exist so
"101%"is a compile error rather than a runtime one.
-
Any of the three, discriminated by
kind.Clients are absent on purpose: a client has a name rather than an id, and nothing numbers it.
-
A menu entry, or a horizontal rule.
tmux spells a separator as one empty argument rather than a name/key/command triple, so modelling it as a distinct value keeps callers from fabricating empty fields that tmux would reject.
-
A leading digit, so
"07%"is not a percentage.
-
What became of one step of a multi-step operation.
skippedis not a failure: a step whose precondition no longer holds is reported rather than retried, so the caller sees why the whole did less than it asked for.
-
A raw format row whose listed identity fields are present.
-
A finite whole number within JavaScript's safe integer range.
Examples
import { safeInteger } from "libtmux";import type { SafeInteger } from "libtmux";const count: SafeInteger = safeInteger(3);
-
A tmux object ID authenticated for one object kind.
-
Raw text or an already-authenticated ID of the expected kind.
-
Called once per tmux invocation, after it answers or fails.
This is the seam for logs, traces and metrics: a caller that wants to see what the library is doing has otherwise to supply a whole engine. It runs after the invocation is decided and cannot change its outcome — anything it throws is swallowed, because a command must not fail on account of the code watching it.
Returning a promise is allowed and never awaited: the invocation has already been decided, so waiting would only delay it. A rejection is swallowed on the same grounds as a throw, rather than left to the host's unhandled rejection policy.
-
Every whole number a percentage may start with, short of one hundred.
- isSafeInteger ( value : : unknown ) value is SafeInteger
-
Test whether a value is an exact JavaScript integer.
Examples
import { isSafeInteger } from "libtmux";const value: unknown = 3;if (isSafeInteger(value)) snapshot.sessions.where({ attached: value });
-
Test whether a value is a name every supported tmux stores unchanged.
The refusal the mutating calls apply, offered ahead of them so a caller validating configuration can report the bad field rather than catching a
TypeErrorfrom the call it fed.Examples
import { isTmuxName } from "libtmux";const value: unknown = "work";const name = isTmuxName(value) ? value : undefined;
- safeInteger ( value : : number ) SafeInteger
-
Authenticate an exact JavaScript integer or throw.
Examples
import { safeInteger } from "libtmux";const pid = safeInteger(42);