# LibTmux.IControlModeSession.SendAsync

- **Module:** LibTmux.IControlModeSession
- **Package:** LibTmux
- **Language:** .NET
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/320dc64f4b8b7815842471327a5e6b84a1499bf8/src/LibTmux/ControlMode/IControlModeSession.cs#L55
- **Page:** https://libtmux.org/en/dotnet/latest/reference/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.
