# LibTmux.IfShellRequest.IfShellRequest

- **Module:** LibTmux.IfShellRequest
- **Package:** LibTmux
- **Language:** .NET
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/6656a563ec9e07ab52e0c3ac96f7704fc94cc0c0/src/LibTmux/Requests/IfShellRequest.cs#L15
- **Page:** https://libtmux.org/reference/dotnet/libtmux-ifshellrequest-ifshellrequest/

```
LibTmux.IfShellRequest.IfShellRequest(shellCommand: string, thenCommand: IReadOnlyList<string>, elseCommand: IReadOnlyList<string>?, background: bool, targetPane: string?)
```

Initializes a conditional command.

## Parameters

- `shellCommand` (string) — The shell command whose success decides.
- `thenCommand` (IReadOnlyList<string>) — The tmux command run when it succeeds.
- `elseCommand` (IReadOnlyList<string>?) — The tmux command run when it fails, when any.
- `background` (bool) — Whether tmux runs the shell command without waiting.
- `targetPane` (string?) — The pane the commands run against.
