Repository navigation
Description
Product requirement
Pictures behave like pictures in two places they don't today:
-
The person's own images render in the transcript. Today a sent image
leaves only a dim marker —› what is wrong with this [image #1] [#1 chart.png](chipMarkers,internal/tui3/attach.go:575). The comment
there says "a terminal cell is not a place to show a picture" — but the
surface already proves otherwise: tool rows draw real half-cell truecolor
thumbnails (imagethumb.go) and expansions draw full pictures
(imagepreview.go). The technique exists; the person's own messages just
don't get it. A sent screenshot should appear as a small thumbnail in the
transcript, same rungs and same degradation as tool rows (TrueColor →
ANSI256 → marker only). -
A dropped image converts to
[image #1], reliably. The paste
substitution (imagepaste.go) handles backslash-escaped spaces, quoted
paths, andfile://URLs — but the person still sees the raw path in the
draft instead of the token. The likely hole: some terminals paste a
dropped file's path with un-escaped spaces, sopastedWordssplits it
into five words, none of which resolves to an image, and the
all-or-nothing substitution is skipped. The space handling was fixed once
(escaped/quoted forms); the un-escaped form is the regression-shaped gap.
Fix direction for the drop
After the word-split fails to resolve, try the whole paste (and each
newline-separated line of it) as one path before giving up: if the entire
string resolves to an existing image file, it is a picture. This covers
un-escaped spaces without guessing, and it can't misfire — a sentence never
resolves to an existing file. Also verify the two other paths that leave the
path as text by design are not the ones firing: the slash-command guard
(input starting with /) and the size ceiling (maxAttachBytes).
Acceptance
- Dropping a screenshot into any of iTerm2, Ghostty, Terminal.app converts
the paste to[image #1]on the tray — including paths pasted with raw
un-escaped spaces. - A sent image-bearing message shows a small thumbnail in the transcript
(half-cell technique, same rungs as tool rows); below ANSI256 it degrades
to today's marker, unchanged. - Regression tests: one paste form per terminal convention (escaped,
quoted,file://, raw spaces), and one transcript render at each palette
rung.
Drafted with CodeAF · reviewed and owned by the author
Activity