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

control.ControlSender.send

Rust
  • Python Unavailable
  • TypeScript Unavailable
  • Rust
  • Go Unavailable
  • Java Unavailable
  • .NET Unavailable
  • C++ Unavailable
  • Swift Unavailable

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.

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.

Cancel safety

A command dropped while queued is never written. Once the connection has committed it, tmux may run it, and its reply is still read and discarded, so later replies stay aligned.

0 declared, 0 inherited

Esc

Type to search.