pty_read
Read output from a terminal session's buffer, either sequentially or by searching with regex patterns to filter specific lines.
Instructions
Reads output from a PTY session's buffer.
The PTY maintains a rolling buffer of output lines. Use offset and limit to paginate through the output.
Two modes:
Standard mode (no pattern): Returns consecutive lines
Search mode (with pattern): Filters lines by regex, returns matches with line numbers
The buffer stores up to PTY_MAX_BUFFER_LINES (default: 50000) lines. Older lines are discarded when the limit is reached.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The PTY session ID (from pty_spawn) | |
| offset | No | Line number to start reading from (0-based, defaults to 0) | |
| limit | No | Number of lines to read (defaults to 500) | |
| pattern | No | Regex pattern to filter lines (enables search mode) | |
| ignoreCase | No | Case-insensitive pattern matching (default: false) |