feat(tui): enable Kitty images for Rex

This commit is contained in:
Nihaal Sangha 2026-10-19 21:46:31 +01:00 • committed by Petr Houška
parent fdce48eb40
commit 396ecd7b8f
2 changed files with 4 additions and 4 deletions

View file

@ -92,10 +92,10 @@ function detectCapabilitiesFromEnvironment(tmuxForwardsHyperlink: () => boolean)
return { images: "kitty", trueColor: hasTrueColorHint, hyperlinks: true };
}
// Rex supports OSC 8 hyperlinks but only partially implements the Kitty graphics protocol
// (no Unicode placeholders), so leave images off. Check it before outer-terminal detection.
// Rex supports OSC 8 hyperlinks and only partially implements the Kitty graphics protocol
// (no Unicode placeholders), but enough to support Pi.
if (termProgram === "rex") {
return { images: null, trueColor: true, hyperlinks: true };
return { images: "kitty", trueColor: true, hyperlinks: true };
}
if (process.env.KITTY_WINDOW_ID || termProgram === "kitty") {

View file

@ -335,7 +335,7 @@ describe("detectCapabilities", () => {
withEnv({ TERM_PROGRAM: "rex", TERM: "xterm-256color", KITTY_WINDOW_ID: "1" }, () => {
const caps = detectCapabilities();
assert.strictEqual(caps.hyperlinks, true);
assert.strictEqual(caps.images, null);
assert.strictEqual(caps.images, "kitty");
assert.strictEqual(caps.trueColor, true);
});
withEnv({ TERM_PROGRAM: "rex", PI_HYPERLINKS: "0" }, () => {