(line: string)
| 144 | const ITERM2_PREFIX = "\x1b]1337;File="; |
| 145 | |
| 146 | export 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. |
no outgoing calls
no test coverage detected