Core Library0.xGuides

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

MoreLess about this notice
Edit this page on GitHub

Getting started

Needs libtmux for Rust 0.x Install

Use libtmux to create sessions, send input and read pane output from Rust. The complete capture program includes imports, its entry point, project files, dependency setup and a run command.

Run the smallest thing that proves it works

Open that example in an empty directory and save the files using their displayed names. Its setup pins the library revision that was used to execute the program. It needs tmux on PATH and the native tools named on the example page.

The program creates a private server, sends a command, waits for the complete line libtmux capture ready, then cleans up. A timeout or command failure is reported. It does not need an existing tmux session.

What just happened

Pane::capture reads the visible screen. The complete program compares the returned line bytes with the expected output and uses tokio::time::timeout to bound the task. It kills its private server and shuts down the client before returning a capture error.

Connect to an existing server

Use the complete attach program to select an existing socket and find the work session. That example leaves your tmux server running. Without a socket, it starts a demonstration server of its own and stops it before exiting.

Where to go next

Sending keys explains input, and Capturing output explains completion. Querying and filtering selects a target.

Esc
Search in

Type to search.

Reference previewOpen reference