ssh_shell_read
Retrieve command output from an active SSH shell session using its session ID, with an option to clear the buffer after reading. Avoid concurrent calls to prevent corruption.
Instructions
Read output from an SSH shell session. Do NOT call this concurrently with ssh_shell_exec/ssh_shell_write on the same session_id — concurrent access to the same SSH shell corrupts the output buffer.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clear | No | Buffer clear flag: 1 (default) = clear buffer after reading, 0 = keep buffer | |
| session_id | Yes | The session ID returned by ssh_shell_open |