diff --git a/packages/coding-agent/CHANGELOG.md b/packages/coding-agent/CHANGELOG.md index ca8b2592..d8cb8802 100644 --- a/packages/coding-agent/CHANGELOG.md +++ b/packages/coding-agent/CHANGELOG.md @@ -4,6 +4,8 @@ ### Added +- **Inline image rendering**: Terminals supporting Kitty graphics protocol (Kitty, Ghostty, WezTerm) or iTerm2 inline images now render images inline in tool output. Aspect ratio is preserved by querying terminal cell dimensions on startup. Toggle with `/show-images` command or `terminal.showImages` setting. Falls back to text placeholder on unsupported terminals or when disabled. ([#177](https://github.com/badlogic/pi-mono/pull/177) by [@nicobailon](https://github.com/nicobailon)) + - **Gemini 3 Pro thinking levels**: Thinking level selector now works with Gemini 3 Pro models. Minimal/low map to Google's LOW, medium/high map to Google's HIGH. ([#176](https://github.com/badlogic/pi-mono/pull/176) by [@markusylisiurunen](https://github.com/markusylisiurunen)) ### Fixed diff --git a/packages/coding-agent/README.md b/packages/coding-agent/README.md index ce090af6..9fd51d00 100644 --- a/packages/coding-agent/README.md +++ b/packages/coding-agent/README.md @@ -165,6 +165,7 @@ The agent reads, writes, and edits files, and executes commands via bash. | `/compact [instructions]` | Manually compact conversation context | | `/autocompact` | Toggle automatic context compaction | | `/theme` | Select color theme | +| `/show-images` | Toggle inline image display (supported terminals only) | ### Editor Features @@ -236,13 +237,17 @@ Run multiple commands before prompting; all outputs are included together. ### Image Support -Include image paths in your message: +**Attaching images:** Include image paths in your message: ``` You: What's in this screenshot? /path/to/image.png ``` -Supported: `.jpg`, `.jpeg`, `.png`, `.gif`, `.webp` +Supported formats: `.jpg`, `.jpeg`, `.png`, `.gif`, `.webp` + +**Inline rendering:** On terminals that support the Kitty graphics protocol (Kitty, Ghostty, WezTerm) or iTerm2 inline images, images in tool output are rendered inline. On unsupported terminals, a text placeholder is shown instead. + +Toggle inline images with `/show-images` or set `terminal.showImages: false` in settings. --- @@ -600,6 +605,9 @@ See [Hooks Documentation](docs/hooks.md) for full API reference. "enabled": true, "maxRetries": 3, "baseDelayMs": 2000 + }, + "terminal": { + "showImages": true } } ``` @@ -609,6 +617,9 @@ See [Hooks Documentation](docs/hooks.md) for full API reference. - `maxRetries`: Maximum retry attempts. Default: `3` - `baseDelayMs`: Base delay for exponential backoff (2s, 4s, 8s). Default: `2000` +**Terminal settings:** +- `showImages`: Render images inline in supported terminals. Default: `true` + --- ## CLI Reference diff --git a/packages/tui/README.md b/packages/tui/README.md index d2c1bec2..f44d8e6e 100644 --- a/packages/tui/README.md +++ b/packages/tui/README.md @@ -209,8 +209,6 @@ tui.addChild(image); Supported formats: PNG, JPEG, GIF, WebP. Dimensions are parsed from the image headers automatically. -Set `PI_NO_IMAGES=1` to disable inline rendering and always use the text fallback. - ## Autocomplete ### CombinedAutocompleteProvider diff --git a/packages/tui/src/terminal-image.ts b/packages/tui/src/terminal-image.ts index 88886e04..c12cf2c9 100644 --- a/packages/tui/src/terminal-image.ts +++ b/packages/tui/src/terminal-image.ts @@ -39,12 +39,6 @@ export function detectCapabilities(): TerminalCapabilities { const termProgram = process.env.TERM_PROGRAM?.toLowerCase() || ""; const term = process.env.TERM?.toLowerCase() || ""; const colorTerm = process.env.COLORTERM?.toLowerCase() || ""; - const disableImages = process.env.PI_NO_IMAGES === "1" || process.env.PI_NO_IMAGES === "true"; - - if (disableImages) { - const trueColor = colorTerm === "truecolor" || colorTerm === "24bit"; - return { images: null, trueColor, hyperlinks: true }; - } if (process.env.KITTY_WINDOW_ID || termProgram === "kitty") { return { images: "kitty", trueColor: true, hyperlinks: true };