# io.github.libtmux.Server.Server.ifShell

- **Module:** io.github.libtmux.Server.Server
- **Package:** io.github.libtmux:libtmux
- **Language:** Java
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-java/blob/c3517519ee799428a809ce6deb1708c8be289cd1/libtmux/src/main/java/io/github/libtmux/Server.java#L247
- **Page:** https://libtmux.org/reference/java/io-github-libtmux-server-server-ifshell/

```
io.github.libtmux.Server.Server.ifShell(condition: String, whenTrue: String) -> void
```

Runs one tmux command or another, according to whether a shell command succeeds.

<p>The choosing happens inside tmux rather than here, which is the point: the condition and
both outcomes go out as one request, so nothing can change between asking and acting.

## Parameters

- `condition` (String) — a shell command, judged by its exit status
- `whenTrue` (String) — the tmux command to run when the condition succeeds
