Core Library0.xAPI 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-swift latest

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

Description#

A tmux error closes the block with %error rather than failing the connection, so it comes back as a reply whose ControlReply.isError is 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 throws TmuxError.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
Esc

Type to search.

Reference previewOpen reference