kitty_get_text
Retrieve text content from a kitty terminal window. Supports visible screen, full scrollback, selected text, or last command output with optional ANSI formatting.
Instructions
Retrieve text content from a kitty window. Supports multiple extent modes: "screen" (visible content), "all" (screen + scrollback), "selection" (selected text), "last_cmd_output" (output of most recent command), and more. When extent is "all", output is truncated to max_lines (keeping most recent lines) to prevent overwhelming context.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ansi | No | Include ANSI formatting/color codes in the output. | |
| self | No | Get text from the window this command runs in. | |
| match | No | Window match expression (e.g. "title:my_term"). | |
| extent | No | What text to retrieve. Default: "screen" (visible content). "all" includes full scrollback. "last_cmd_output" gets output of the most recent shell command (requires shell integration). | |
| max_lines | No | Maximum lines to return. When exceeded, oldest lines are truncated. Default: 50000. | |
| add_cursor | No | Add cursor position and style as ANSI codes. | |
| clear_selection | No | Clear the selection after retrieving it. | |
| add_wrap_markers | No | Add carriage returns at line-wrap positions. |