ControlSession.send(_:)
Sends a command and waits for the block tmux brackets its reply with.
Source and package
- Qualified name
-
ControlSession. send(_:) - Declared in
ControlSession- Package
- libtmux-swift
- Source
- Sources/LibTmux/ControlSession.swift
- send(command: Tmux
Command ) -> ControlReply -
Description#
A tmux error closes the block with
%errorrather than failing the connection, so it comes back as a reply whoseControlReply.isErroris set — the same way a nonzero exit is a reply elsewhere in this library.Concurrent sends are safe. tmux answers in the order it receives commands, so replies are matched to waiters in that order — which holds because writes are chained, not merely because they are usually fast. A reply exceeding 1 MiB fails with
TmuxError.outputLimitExceeded(perStreamBytes:).The command is read before it is sent, like one given to
Server/run(_:)-(TmuxCommand): a refused command throwsTmuxError.unsupportedTmuxVersion(reported:required:operation:)or, for a JSON layout,TmuxError.invocationFailed(reason:)before this call sends the command. Nested command strings are not read; see <doc:PlatformSupport>.- Parameters
- Raises