# LibTmux.CommandPromptRequest.ToCommand

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** C#
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/cf34b255c896d19a97e7d7fabea58609c916012d/src/LibTmux/Requests/CommandPromptRequest.cs#L87
- **Page:** https://libtmux.org/en/csharp/latest/reference/libtmux-commandpromptrequest-tocommand/

```
LibTmux.CommandPromptRequest.ToCommand(server: Server) -> TmuxCommand
```

Returns a prompt request as one tmux command.

Batching does not soften the refusal below tmux 3.3: that version reads
the type flag as something else, so a prompt asking for one is refused
here exactly as it is when run alone.

## Parameters

- `server` (`Server`): The server the prompt is shown on.

## Returns

The command, ready to add to a <see cref="TmuxChain" />.

## Raises

- [`ArgumentNullException`](https://learn.microsoft.com/dotnet/api/system.argumentnullexception): <paramref name="server" /> is null.
- [`TmuxVersionTooLowException`](/en/csharp/latest/reference/libtmux-tmuxversiontoolowexception/): The request asks for a format or a prompt type and tmux is older than 3.3.
