# LibTmux.TmuxChaining.ToCommands

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** C#
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/cf34b255c896d19a97e7d7fabea58609c916012d/src/LibTmux/Chaining/TmuxChaining.Hooks.cs#L76
- **Page:** https://libtmux.org/en/csharp/latest/reference/libtmux-tmuxchaining-tocommands/

```
LibTmux.TmuxChaining.ToCommands(request: SetHooksRequest, hooks: TmuxHooks) -> IReadOnlyList<TmuxCommand>
```

Returns every command a multi-entry hook request sends.

This request is several tmux commands rather than one, so it answers a
list. Running them one at a time is what the one-shot path does; adding
them to a chain is what this is for.

## Parameters

- `request` (`SetHooksRequest`): Which hook to set, and to what entries.
- `hooks` (`TmuxHooks`): The hooks handle whose scope holds it.

## Returns

The commands, in the order tmux must receive them.

## Raises

- [`ArgumentNullException`](https://learn.microsoft.com/dotnet/api/system.argumentnullexception): An argument is null.
