# io.github.libtmux.Shell.choose

- **Module:** io.github.libtmux
- **Package:** io.github.libtmux:libtmux
- **Language:** Java
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-java/blob/f56392b5d9bc7f1f9c1631842333fb90f3d82d40/libtmux/src/main/java/io/github/libtmux/Shell.java#L64
- **Page:** https://libtmux.org/en/java/latest/reference/io-github-libtmux-shell-shell-choose/

tmux command: [`if-shell`](/en/tmux/latest/manual/if-shell/)

```
io.github.libtmux.Shell.choose(condition: String, whenTrue: String) -> void

io.github.libtmux.Shell.choose(condition: String, whenTrue: String, whenFalse: String) -> void
```

Runs one tmux command when a shell command succeeds.

## Parameters

- `condition` (`String`): a shell command, judged by its exit status (for `choose(condition, whenTrue)`)
- `whenTrue` (`String`): the tmux command to run when the condition succeeds (for `choose(condition, whenTrue)`)
- `whenFalse` (`String`): the tmux command to run when the condition does not succeed (for `choose(condition, whenTrue, whenFalse)`)
