Repository navigation
Conversation
…al panes Load @xterm/addon-image into every pane terminal so image escape sequences emitted by agents (pi, oh-my-pi, Kimi Code) and tools (img2sixel, imgcat) render in the grid instead of being parsed and dropped. - enableSizeReports stays off: Orca answers CSI 14t/16t through its own replay- and mobile-gated responder; a second reply would reach the shell. - Per-pane image cache capped at 32 MB; many panes share one renderer. - Pinned to 0.10.0-beta.300, whose peer range matches @xterm/xterm 6.1.0-beta.303; beta.301 needs BufferLine.getExtended from beta.304 and renders nothing on the current xterm. Fixes stablyai#11668
📝 WalkthroughWalkthroughThe terminal pane manager now supports inline images through Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: 🔵 Low · up to Inline-image capability replies currently retain Orca’s DA1 response, but the regression test should cover the production setup path to prevent a future ordering change from silently altering terminal capability negotiation. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
ℹ️ No critical issues — one optional regression-test suggestion inline.
Reviewed changes
- Inline-image addon wired into every pane:
createPaneDOMbuilds anImageAddon(SIXEL, iTerm2 IIP, Kitty) through a newcreateTerminalImageAddon()factory,openTerminalloads it beside the other pane addons, anddisposePanedisposes it.ManagedPaneInternalgains the field and all pane fixtures were updated. enableSizeReports: false: the addon is configured not to touchwindowOptions, so xterm core adds no second reply toCSI 14t/16t/18tnext to Orca's own responder;storageLimitis lowered to 32 MB per pane.- Dependency pin:
@xterm/[email protected](peer-compatible with the pinned@xterm/[email protected]), with aterminal-image-addon.test.tsguard that loading the addon leaves the size queries unanswered. - Docs: new "Inline images" section in
docs/site/content/docs/terminal.mdx.
I verified the guard is meaningful rather than tautological: with enableSizeReports: true the same headless terminal replies \x1b[8;24;80t to CSI 18t, so the assertion would fail if the option regressed. I also ran the full pane-manager suite (80 files / 867 passed) and pnpm run typecheck:web; both are green.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…sement addon-image registers its own CSI c handler; Orca's reply wins only because handlers dispatch last-registered-first and the PTY connection installs Orca's after openTerminal loaded the addon. Record the constraint and guard it.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Exercise the production registration path in the DA1/SIXEL regression… · pane-lifecycle.ts:42-58
src/renderer/src/lib/pane-manager/pane-lifecycle.ts:42-58
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winExercise the production registration path in the DA1/SIXEL regression test. Production registers the image addon's handler in
openTerminal, then registers Orca's handler throughconnectPanePty→installPtyInputRecovery. The runtime order is correct. However, the test creates a standaloneTerminal, loads the image addon, and callsinstallTerminalCapabilityReplyHandlersdirectly. It does not exerciseopenTerminalorconnectPanePty. A future production reorder can therefore leave the test passing while the addon answers DA1 with its SIXEL advertisement instead of Orca's configured response. Add this assertion through the production pane/PTY setup.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: a622730a-07d5-4af0-be1e-1c818213fcb7
📒 Files selected for processing (2)
src/renderer/src/components/terminal-pane/terminal-capability-replies.test.tssrc/renderer/src/lib/pane-manager/terminal-image-addon.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/renderer/src/lib/pane-manager/terminal-image-addon.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Pinned the DA1 load-order invariant:
terminal-capability-replies.test.tsnow loads the image addon beforeinstallTerminalCapabilityReplyHandlers, writesCSI c, and asserts Orca's?1;2creply wins whileonDatastays silent. - Documented the constraint: a comment next to
sixelSupportinterminal-image-addon.tsrecords why Orca's DA1 handler must be registered after the addon.
I independently confirmed the new test is meaningful rather than tautological: with the two registrations reversed, sendInput receives zero calls, so the assertion fails if the ordering invariant breaks. terminal-capability-replies.test.ts (17 tests) passes.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

ELI5
Coding agents like pi / oh-my-pi / Kimi Code can show screenshots and generated images right inside the terminal, the way Ghostty, iTerm2, and Windows Terminal do. Orca's terminal silently threw those images away. Now it draws them.
What Changed
Before: an agent (or
img2sixel,imgcat) prints an image escape sequence and Orca shows nothing — the sequence is parsed and dropped, so users have to open every screenshot externally.After: terminal panes load
@xterm/addon-image, xterm.js's inline-image addon. SIXEL, iTerm2OSC 1337 File=and Kitty graphics images render in the grid, scroll with their surrounding text, survive pane resize, and are cleared when overwritten.Mechanism:
terminal-image-addon.tsbuilds the addon withenableSizeReports: false— Orca already answersCSI 14t/16tthrough its own replay- and mobile-gated responder (terminal-capability-replies.ts); a second ungated reply would leak into the shell as stray input. Per-terminal image cache is capped at 32 MB (addon default 128 MB) because many panes share one renderer process.createPaneDOM, loaded inopenTerminalnext to the other pane addons, and disposed indisposePane.0.10.0-beta.300, whose peer range matches Orca's@xterm/[email protected].beta.301requires xtermbeta.304(newBufferLine.getExtended) and renders nothing onbeta.303; bumping xterm is out of scope for this PR.docs/site/content/docs/terminal.mdx.Not changed: DA1 (
CSI c) still reports?1;2con macOS/Linux, so tools that pick a protocol from DA1 won't self-select SIXEL yet; on Windows the ConPTY reply (?61;4c) already advertises SIXEL. Agents that need a hint can setPI_FORCE_IMAGE_PROTOCOL=iterm2(pi / oh-my-pi). Advertising SIXEL in DA1 touches the main-process query responders and their pinned tests, so it's a natural follow-up.Why
#11668 has multiple reports (pi, Kimi Code, oh-my-pi on Windows + macOS). Windows reporter confirmed OMP emitted SIXEL that Orca dropped — matching the code path: raw PTY bytes reach
terminal.write()unmodified, nothing consumes the DCS/OSC/APC image payloads.Alternatives considered: writing a Kitty/IIP parser + canvas overlay by hand (large, duplicates the upstream addon); bumping xterm to
beta.304to use the newest addon (unrelated renderer changes, riskier for golden tests). The pinned addon is the smallest change with upstream-maintained decoders.Linked Issue
Fixes #11668
Visual Proof
BEFORE — image sequences reserve blank rows, pixels never appear:

AFTER — SIXEL bands + iTerm2 PNG rendered in the same pane (WebGL renderer):

AFTER — oh-my-pi inside Orca reading a PNG with

PI_FORCE_IMAGE_PROTOCOL=iterm2:Testing
Manual, macOS 15 (arm64),
pnpm dev, WebGL renderer on:printf '\ePq"1;1;60;24#0;2;100;0;0…\e\\'(SIXEL) andprintf '\e]1337;File=inline=1;width=40:<base64 png>\a'(IIP) in a pane → both render.PI_FORCE_IMAGE_PROTOCOL=iterm2 omp, ask it toreada PNG → image shown inline in the agent transcript.seq 1 30→ images stay anchored to their rows.Not tested: Linux, Windows, SSH worktrees. Rendering is renderer-side only, so the data path is identical over SSH; the Windows DA1 already advertises SIXEL, so tools that gate on it should start showing images there.
terminal-image-addon.test.tsguards that the addon never answers window-size reports (the one setting whose regression would inject stray input into the shell). ExistingManagedPaneInternalfixtures gained theimageAddonfield. Pixel rendering itself needs a canvas and is covered by manual verification.AI Disclosure
Implemented with Claude (Anthropic) via the oh-my-pi coding agent; reviewed and verified manually by the author.
Review
Cross-platform: renderer-only, no OS-specific code. SSH/remote: no transport change. Agents/integrations: provider-neutral (no agent-specific env injection). Performance: addon hooks
onRenderand walks visible rows for image tiles only when images exist in storage;storageLimitcaps memory per pane. Security: addon size limits (pixelLimit,*SizeLimit) stay at defaults; no new terminal reports are enabled.Agent skill upstream boundary
Checklist
pnpm lint,pnpm typecheckpass locally; pane-managervitestsuite passes;pnpm test/pnpm build— CIAuthor: @MikhailGA