Getting started
Needs libtmux for C++ 0.x Install
Use libtmux to create sessions, send input and read pane output from C++.
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 returns captured text through a result that must be checked.
The complete program splits that text into lines and compares a whole line
before its deadline. Capture options select history and bound the output size;
an exceeded output limit is reported as an error.
Connect to an existing server
Use the complete attach program to select an existing
socket and find the work session. That example leaves that server running.
Without LIBTMUX_SOCKET_PATH, it starts a private server, looks up that
server’s work session and stops the server.
Where to go next
Sending keys explains input, and Capturing output explains completion. Querying and filtering selects a target.