API Reference

libtmux’s public API mirrors tmux’s object hierarchy: ServerSessionWindowPane

What do you want to do?

Find a session, window, or pane?

Use server.sessions.get(), session.windows.get().

Servers
Send commands or keys to a terminal?

Use pane.send_keys() and pane.enter().

Panes
Capture output from a pane?

Use pane.capture_pane().

Panes
Write tests against tmux?

Use the pytest plugin and test helpers.

Testing Utilities

Core Objects

Server

Entry point. Manages sessions and executes raw tmux commands.

Servers
Session

Manages windows within a tmux session.

Sessions
Window

Manages panes, layouts, and window operations.

Windows
Pane

Terminal instance. Send keys and capture output.

Panes

Supporting Modules

Common

Base classes and command execution.

Utilities
Neo

Dataclass-based query interface.

Properties
Options

tmux option get/set.

Options
Hooks

tmux hook management.

Hooks
Constants

Format strings and constants.

Constants
Exceptions

Exception hierarchy.

Exceptions

Testing

Testing Utilities

pytest plugin, fixtures, and test helpers for testing code that uses libtmux.

Testing Utilities

API Policy and Guarantees

These documents define the project’s promises about the public API.

Public API

What is and is not considered stable public API.

Public API
Compatibility

Supported versions of Python and tmux.

Compatibility
Deprecations

Active deprecations and migration guidance.

Deprecations