Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/bright-orcas-render.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/pi-tui": patch
---

Recognize Orca terminals that advertise Kitty inline-image support.
5 changes: 5 additions & 0 deletions .changeset/calm-images-display.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Display inline images when Orca explicitly advertises Kitty graphics support.
4 changes: 4 additions & 0 deletions packages/pi-tui/src/terminal-image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ export function detectCapabilities(tmuxForwardsHyperlink: () => boolean = probeT
return { images: null, trueColor: hasTrueColorHint, hyperlinks: false };
}

if (termProgram === "orca" && process.env['ORCA_IMAGE_PROTOCOL'] === "kitty") {
return { images: "kitty", trueColor: true, hyperlinks: true };
}

if (process.env['KITTY_WINDOW_ID'] || termProgram === "kitty") {
return { images: "kitty", trueColor: true, hyperlinks: true };
}
Expand Down
17 changes: 17 additions & 0 deletions packages/pi-tui/test/terminal-image.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
const ENV_KEYS = [
"TERM",
"TERM_PROGRAM",
"ORCA_IMAGE_PROTOCOL",
"TERMINAL_EMULATOR",
"COLORTERM",
"TMUX",
Expand Down Expand Up @@ -273,6 +274,22 @@ describe("detectCapabilities", () => {
});
});

it("keeps images disabled for Orca without an image capability signal", () => {
withEnv({ TERM_PROGRAM: "Orca" }, () => {
const caps = detectCapabilities();
assert.strictEqual(caps.images, null);
});
});

it("enables images and hyperlinks for Orca advertising Kitty support", () => {
withEnv({ TERM_PROGRAM: "Orca", ORCA_IMAGE_PROTOCOL: "kitty" }, () => {
const caps = detectCapabilities();
assert.strictEqual(caps.images, "kitty");
assert.strictEqual(caps.trueColor, true);
assert.strictEqual(caps.hyperlinks, true);
});
});

it("enables images and hyperlinks for Warp via TERM_PROGRAM", () => {
withEnv({ TERM_PROGRAM: "WarpTerminal" }, () => {
const caps = detectCapabilities();
Expand Down