MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / isImageLine

Function isImageLine

packages/pi-tui/src/terminal-image.ts:146–153  ·  view source on GitHub ↗
(line: string)

Source from the content-addressed store, hash-verified

144const ITERM2_PREFIX = "\x1b]1337;File=";
145
146export function isImageLine(line: string): boolean {
147 // Fast path: sequence at line start (single-row images)
148 if (line.startsWith(KITTY_PREFIX) || line.startsWith(ITERM2_PREFIX)) {
149 return true;
150 }
151 // Slow path: sequence elsewhere (multi-row images have cursor-up prefix)
152 return line.includes(KITTY_PREFIX) || line.includes(ITERM2_PREFIX);
153}
154
155/**
156 * Generate a random image ID for Kitty graphics protocol.

Callers 9

applyLineResetsMethod · 0.90
compositeLineAtMethod · 0.90
doRenderMethod · 0.90
fullRenderMethod · 0.90
repaintViewportMethod · 0.90
renderMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected