# ControlSession.send(_:)

- **Module:** ControlSession
- **Package:** libtmux-swift
- **Language:** Swift
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-swift/blob/f02a4668570e1cc5198c941413750e021f42c214/Sources/LibTmux/ControlSession.swift#L167
- **Page:** https://libtmux.org/reference/swift/controlsession-send(_-)/

```
ControlSession.send(_:)(command: TmuxCommand) -> ControlReply
```

Sends a command and waits for the block tmux brackets its reply with.

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:)``.

## Raises

- `TmuxError`
