terminal_read
Extract text from terminal windows using UIA or OCR, strip ANSI codes, and retrieve only new output with diff mode to reduce processing overhead.
Instructions
Read current text from a terminal window via UIA TextPattern (falls back to OCR). Strips ANSI escape sequences. sinceMarker: pass the marker from a previous response to get only new output (diff mode — cheaper than full read). Caveats: When the underlying process restarts, the marker is invalidated and full text is returned.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| windowTitle | Yes | Partial title of the terminal window (e.g. 'PowerShell', 'pwsh', 'WindowsTerminal'). | |
| lines | No | Tail N lines (default 50). | |
| sinceMarker | No | Marker returned from a previous call. If found in current text, only the diff is returned. | |
| stripAnsi | No | Strip ANSI escape sequences (default true). | |
| source | No | 'auto' = UIA TextPattern then OCR fallback; 'uia' = TextPattern only (fail on miss); 'ocr' = OCR only. | auto |
| ocrLanguage | No | BCP-47 language tag for OCR fallback (default 'ja'). | ja |