feat(parse): add ExtractImages stream scanner for OSC 9 markers

Implements ExtractImages() which scans filter stdout line-by-line,
extracts valid OSC 9 image markers into ImageRef structs, and replaces
marker lines with null-delimited placeholders (\x00IMG:N\x00). Invalid
markers (missing path) pass through unchanged. Also clarifies the Index
field comment in ImageRef to indicate it is set by ExtractImages, not
ParseImageOSC.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Mortdecai
2026-04-07 20:01:10 -04:00
parent 00a6660db5
commit b3bbd55551
3 changed files with 143 additions and 1 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ import (
// ImageRef represents an image referenced by a filter via OSC 9 marker.
type ImageRef struct {
Index int // Sequential position in the message
Index int // Sequential position in the message; set by ExtractImages, not ParseImageOSC
Path string // Absolute path to image file on disk
Alt string // Alt text fallback
}