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

C++ workspace builder examples

Edit this page on GitHub

workspace consumer 0.1.0-alpha.10 · Source

The consumer’s builder test creates an editor window with two panes and a logs window with one pane. It uses ScopedTmuxServer to isolate and clean up tmux.

Describe two windowsLink to section

With libtmux_consumers/workspace.hpp included and a core Server named server, this is the description used by the real-tmux test:

namespace workspace = libtmux::workspace;
const workspace::Workspace description{
.session_name = "built",
.windows = {{.name = "editor", .panes = {{}, {}}},
{.name = "logs", .panes = {{}}}}};
const auto built = workspace::build(server, description);
if (!built.has_value()) {
throw std::runtime_error(built.error().reason);
}

The error-handling line needs <stdexcept>. The consumer headers and workspace_builder target come from the source checkout. For a complete isolated setup, run the linked test rather than targeting your normal server.

YAML and command checksLink to section

tmuxp_test.cpp reads command shorthand and mappings, reports unsupported fields, and verifies the resulting values. workspace_test.cpp checks live windows and panes, command delivery under non-default pane indexes, environment values, and text sent without Enter.

Run both groups with the consumer guide. These tests exercise the consumer’s public use of libtmux; they do not make its workspace types part of the installed core package.

Builder test; YAML tests.

Esc

Type to search.