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

Edit this page on GitHub

tmuxp describes sessions, windows, panes, and shell commands in configuration files. Several libtmux ports provide builders for this format. Source details identify the example files and their checks.

For Python, use tmuxp, a separate application built on libtmux’s Server, Session, Window, and Pane APIs.

TypeScript’s applyWorkspace reuses existing objects when the same configuration is applied again.

Go’s Example(), in workspace/example_test.go, is a Go Example function: go test runs it and checks its output against the // Output: comment at the end, so this is executed on every test run rather than merely present in a README. Parse rejects a field it doesn’t recognize rather than dropping it silently, and reports every problem it finds at once with the line it’s on. Build is not atomic: tmux has no transaction, so a failure partway through leaves whatever was already created in place, identified by the session Build still returns.

Rust’s freeze(&session).await? exports an existing session to the workspace format. It recovers windows, panes, and working directories, but cannot recover the shell command originally typed to start a process.

Java’s read and parse validate the configuration and return a Workspace value. Only build changes tmux state.

The .NET builder can wait for shell readiness before sending commands; Sending keys explains the startup race. It polls pane_current_command, cursor_x, and cursor_y for up to ten seconds by default. PaneReadiness.Auto waits for zsh, Always waits for every pane running the session’s default shell, and Never sends immediately. If BuildAsync fails partway through, WorkspaceBuildException.PartialResult identifies what was created.

C++‘s examples/workspace/ implements a consumer of the core API with its own workspace.hpp and tmuxp.hpp types. Those types are part of the example, not the library package. See the example’s README to adapt it.

Swift’s WorkspaceBuilder.build rejects an existing session with the requested name. Workspace.decode(yaml:) reads tmuxp YAML when the YAMLWorkspaces trait is enabled. Workspace.decode(json:) needs no additional trait.

Where this comes fromLink to section

PythonLink to section

Source: Not listed.

In this page: no fence; the README says tmuxp is a separate project by design

Checked by: n/a

TypeScriptLink to section

Source: examples/workspace/workspace.ts (@libtmux/workspace)

In this page: read whole from the file

Checked by: run against real tmux by bun test examples/workspace

GoLink to section

Source: workspace/example_test.go (workspace.Parse / workspace.Build)

In this page: read whole from the file

Checked by: Example() and its siblings run under go test and are checked against their own // Output: comments

RustLink to section

Source: crates/tmux-workspace/README.md, “Build it”

In this page: hand-quoted

Checked by: the crate’s own crates/tmux-workspace/src/lib.rs includes the README as a doc comment (#![doc = include_str!("../README.md")]), so cargo test --doc runs this exact block

JavaLink to section

Source: libtmux-workspace/README.md, “What you get back”

In this page: hand-quoted

Checked by: every Java fence in the module’s README is compiled and run against real tmux by docs-tests

.NETLink to section

Source: src/LibTmux.Workspace/README.md

In this page: hand-quoted

Checked by: one of the READMEs and docs ReadmeExampleTests compiles and runs against real tmux

C++Link to section

Source: examples/workspace/ (a consumer, not a library API)

In this page: prose only

Checked by: examples/workspace/tests/ runs it against real tmux; ctest -R consumer.workspace selects it. It exercises the example’s own types, not a published libtmux API

SwiftLink to section

Source: Examples/Sources/ExampleCode/Workspaces.swift

In this page: read whole from the file

Checked by: matched against the README’s “Workspaces, from a file or from Swift” section by Scripts/check_examples.py; compiled and run by swift test --package-path Examples

Source inclusionLink to section

Rust, Java, and .NET use copied excerpts from their README examples. The source details above identify those files and their checks.

Esc

Type to search.