# LibTmux.TmuxKeys.BindAsync

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** C#
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/cf34b255c896d19a97e7d7fabea58609c916012d/src/LibTmux/Keys/TmuxKeys.cs#L26
- **Page:** https://libtmux.org/en/csharp/latest/reference/libtmux-tmuxkeys-bindasync/

tmux command: [`bind-key`](/en/tmux/latest/manual/bind-key/)

```
LibTmux.TmuxKeys.BindAsync(request: BindKeyRequest, cancellationToken: CancellationToken) -> Task
```

Binds a key to a tmux command.

## Parameters

- `request` (`BindKeyRequest`): Which key, to what, and in which table.
- `cancellationToken` (`CancellationToken`): Cancels the tmux command.

## Returns

A task that completes once the binding is in place.

## Raises

- [`ArgumentNullException`](https://learn.microsoft.com/dotnet/api/system.argumentnullexception): <paramref name="request" /> is null.
