Core LibraryalphaTopics

Choose documentation 3

latest

Current version

latest
English

Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

Edit this page on GitHub

Architecture

A server handle selects a tmux server. Object IDs select sessions, windows, and panes within it. For the object hierarchy and stable IDs, start with Server, session, window, pane.

Calling operations

Session, window, and pane handles carry their ID and server context. Call an operation on the object you want to change. The examples below send input and kill that pane.

await pane.sendKeys("echo hi");
await pane.kill();

Reading tmux fields

Object IDs become tmux targets (-t). Format variables (#{...}) provide the state returned by tmux.

packages/libtmux/src/_generated/format_fields.ts records each token’s scope and first tmux version. packages/libtmux/src/_generated/field_aliases.ts provides camelCase aliases for fields on Pane, Session, and Window.

Source layout

The public classes live in packages/libtmux/src/server.ts, packages/libtmux/src/session.ts, packages/libtmux/src/window.ts, packages/libtmux/src/pane.ts, and packages/libtmux/src/client.ts.

Their operations are split by concern under packages/libtmux/src/_internal/operations/, including packages/libtmux/src/_internal/operations/pane_io.ts, packages/libtmux/src/_internal/operations/hooks.ts, packages/libtmux/src/_internal/operations/options.ts, and packages/libtmux/src/_internal/operations/topology.ts. packages/libtmux/src/_generated/ contains the generated field catalogs. Workspaces and the MCP server have separate packages in the same repository.

Esc

Type to search.

Reference preview Open reference