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
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| Session | String | No | cmd | Name of the command session, from Open command session. |
| Wait for | String | No | Wait 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 type | String | No | text | How wait_for is matched: as plain text, or as a regular expression, e.g. [A-Z]:\.*>$ for any cmd prompt. |
| Timeout (seconds) | Number | No | 30 | Longest time to wait. |
| From | String | No | new | new: only output since the last read; all: everything the session has printed (the newest 2,000,000 characters). |
| Fail on timeout | Boolean | No | true | When wait_for does not appear in time (or the program ends first), fail the step; off: return with matched false. |
Outputs
| Output | Type | What it is |
|---|---|---|
| output | String | The output read (up to the end of wait_for when it was found); secrets written to the session show as ****. |
| matched | Boolean | True when wait_for was found. |
| exited | Boolean | True when the program has ended. |
| exit_code | Number | The program's exit code once it has ended; -1 while it runs. |