Skip to main content

Read command session

Read what the program of a command session printed, optionally waiting until some text (e.g. its prompt) appears.

Command in the Application toolkit · id ooa.application/read_session · 6 inputs, 4 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
SessionStringNocmdName of the command session, from Open command session.
Wait forStringNoWait until this appears in the output, e.g. the prompt or a question. Empty: return what is there once the output has been quiet for half a second.
Match typeStringNotextHow wait_for is matched: as plain text, or as a regular expression, e.g. [A-Z]:\.*>$ for any cmd prompt.
Timeout (seconds)NumberNo30Longest time to wait.
FromStringNonewnew: only output since the last read; all: everything the session has printed (the newest 2,000,000 characters).
Fail on timeoutBooleanNotrueWhen wait_for does not appear in time (or the program ends first), fail the step; off: return with matched false.

Outputs​

OutputTypeWhat it is
outputStringThe output read (up to the end of wait_for when it was found); secrets written to the session show as ****.
matchedBooleanTrue when wait_for was found.
exitedBooleanTrue when the program has ended.
exit_codeNumberThe program's exit code once it has ended; -1 while it runs.