Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

function libtmux-swift latest

waitForShellPrompt(on:within:)

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

Source and package
Qualified name
waitForShellPrompt(on:within:)
Package
libtmux-swift
Source
Tests/TmuxFixture/TmuxFixture.swift
waitForShellPrompt(on: Server, within: Duration) -> ()

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 — 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.

Parameters
Raises
Esc

Type to search.

Reference previewOpen reference