waitForShellPrompt(on:within:)
Waits until a pane's shell has drawn its first prompt.
Source and package
- Qualified name
-
waitFor Shell Prompt(on: within:) - Package
- libtmux-swift
- Source
- Tests/TmuxFixture/TmuxFixture.swift
-
Description#
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 —
shis dash on Linux and bash on macOS, which printssh-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.