# LibTmux.IControlModeSession.SendAsync

- **Module:** LibTmux.IControlModeSession
- **Package:** LibTmux
- **Language:** .NET
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/6656a563ec9e07ab52e0c3ac96f7704fc94cc0c0/src/LibTmux/ControlMode/IControlModeSession.cs#L55
- **Page:** https://libtmux.org/reference/dotnet/libtmux-icontrolmodesession-sendasync/

```
LibTmux.IControlModeSession.SendAsync(command: TmuxCommand, cancellationToken: CancellationToken) -> Task<IReadOnlyList<string>>
```

Runs one command on this client and reads what it answered.

tmux answers commands in the order it received them, so this is safe to
call concurrently: each caller gets its own answer rather than someone
else's. Cancelling stops the wait, not the command; tmux has already
been told.

## Parameters

- `command` (TmuxCommand) — The typed command to run.
- `cancellationToken` (CancellationToken) — Stops waiting for the answer.

## Returns

The lines tmux printed, empty when it printed nothing.

## Raises

- `ControlModeCommandException` — Tmux reported the command failed.
- `ArgumentException` — The rendered command is too large for one bounded request.
- `StaleServerGenerationException` — The command targets a different tmux server generation.
- `InvalidOperationException` — The client is no longer running or has too many unanswered commands.
