Core LibraryalphaAPI Reference

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.

method libtmux-cxx latest

Server.control

Open a control-mode connection to one session.

Source and package
Qualified name
libtmux::Server::control
Namespace
libtmux
Declared in
Server
Package
libtmux-cxx
Source
include/libtmux/server.hpp
[[C++ nodiscard attributeAsks the compiler to warn when a result is discarded. An explicit cast to void acknowledges that the result is intentionally ignored.Language documentation]] expected<Connection, ProtocolError> control(std::string_view session) const;

Description#

This is the streaming half of the transport: a control connection stays open, exposes guarded reply blocks in wire order, and delivers events outside those blocks. The synchronous surface above is unaffected — a caller who never opens one never pays for it. A guarded block is not a final result for commands whose work tmux completes asynchronously.

Fails with ProtocolError, not CommandFailure, because that is what the Connection it returns speaks: an error type here that the value's own surface does not use would make the doorway disagree with the room.

Parameters

Guides#

Pages that discuss control.

Esc

Type to search.

Reference previewOpen reference