libtmux Reference MCP Search
On this page

control.ControlSender.send

View as Markdown

Module
control
Declared in
ControlSender
Package
libtmux
Source
crates/libtmux/src/control.rs
send ( self , command : Command ) Result<BlockResult, Error>
method [source]
method [source]
send

Send one command and wait for its result block.

A block that tmux closed with %error is a result, not an error: it is reported through BlockResult::succeeded , the same way the process API keeps a nonzero exit status as data.

The block says tmux answered the command, not that what the command asked for has happened. Almost always those are the same moment. They are not for the commands tmux answers at once and then parks this client's queue behind: `wait-for <channel>until something signals it, andrun-shellwithout-b` for as long as its shell command runs. Each reports success, neither has finished, and the next command sent waits for it however long that is. Send those through crate::Server::cmd, where the wait costs one process rather than the connection everything else on it is sharing.

Dropping this future while it is queued prevents the command from being written. Once the connection commits it for writing, tmux may execute it; its reply position stays reserved so later replies remain aligned.

Errors

Returns an error when the command cannot be written as a control-mode line, the connection has closed, or its deadline elapses while queued, being written, or awaiting a response.

0 declared, 0 inherited

Esc

Type to search.