Skip to main content

Wait for prompt

On VT (SSH) hosts: wait until the host has finished writing and the cursor sits after a prompt such as $, # or >, e.g. after a command.

Command in the Terminal emulator toolkit · id ooa.terminal/wait_for_prompt · 5 inputs, 2 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
SessionStringNoterminalSession name.
PromptStringNo[$#>%]\s*$Regular expression the text before the cursor must end with; a shell prompt ($, #, >, %) when empty.
Timeout (seconds)NumberNo30Maximum wait.
Quiet (milliseconds)NumberNo300The screen must stay unchanged this long, so a prompt-like character in the middle of output does not count.
Fail on timeoutBooleanNotrueStop with an error on timeout; when off, found is false instead.

Outputs​

OutputTypeWhat it is
foundBooleanTrue when the prompt appeared in time (false only when fail_on_timeout is off).
prompt_lineStringThe line with the prompt, as shown.