# waitForShellPrompt(on:within:)

- **Package:** libtmux-swift
- **Language:** Swift
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-swift/blob/f02a4668570e1cc5198c941413750e021f42c214/Tests/TmuxFixture/TmuxFixture.swift#L127
- **Page:** https://libtmux.org/reference/swift/waitforshellprompt(on-within-)/

```
waitForShellPrompt(on:within:)(on: Server, within: Duration) -> ()
```

Waits until a pane's shell has drawn its first prompt.

Keys sent before that are echoed with no prompt in front of them, which
leaves the prompt to land on the row the command's own output wants. A case
looking for a row equal to what it printed is then waiting for something
that cannot arrive, and reports it as a timeout naming nothing. One capture
settles it for every case that follows.

What the prompt *says* is not portable — `sh` is dash on Linux and bash on
macOS, which prints `sh-3.2$` — so readiness is that the pane has drawn
anything at all. Until the shell starts it has drawn nothing.

This reads the pane directly rather than through the wait machinery: a
fixture that bootstrapped itself with the code under test would make every
unrelated case depend on it.
