You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Three user-reported failures collapse into one release:
1. "I highlighted text in tmux and now image paste delivers log
junk instead of my screenshot." The tmux `@clip` auto-copy
drops every highlight into xclip, so X11 CLIPBOARD ends up
text-typed while the daemon still has the screenshot staged.
v1.23's clipboard_holds_user_text punt-to-bash made bash
deliver the highlighted text; v1.24 removed that and forced
image dispatch, which then broke the legitimate "user copied
text in browser, wants to paste text" case. v1.25 does the
right thing with a live X11 probe: if X11 is owned by an
external app advertising text-only targets, scrape and
dispatch the text; otherwise dispatch our staged image. The
staged image stays in memory either way, so the next paste
without text-overlay still serves it.
2. "Claude Code says 'no image found' even when an image is
supposedly staged." Root cause: `xclip -selection clipboard
-t image/png -o` on a text-only clipboard does NOT exit
empty — it silently returns the text bytes (xclip falls
back to whatever's in the selection if the requested MIME
isn't on offer). The wl-paste shim was forwarding that
text-as-image lie to Claude, which decoded the bytes,
failed to find a PNG header, and reported "no image found"
while raw text dumped into the chat input. New shim
behaviour: when a MIME-typed target is requested, probe
TARGETS first; exit 1 with no stdout if the mime isn't
advertised, matching what a real wl-paste does.
3. "I could paste only into one Claude Code chat — the rest
don't get my image." The daemon dispatched via
`kitty @ send-text` which matches `state:active` — kitty
injects the byte into ITS active window only. With multiple
kitty windows/tabs each running tmux + Claude, only one
gets the byte. v1.25 adds `tmux::send_ctrl_v_to_pane`
(`tmux send-keys -t <pane> -l \x16`) which writes the
literal Ctrl-V byte directly into the named pane's pty,
bypassing kitty's window filter. (paste.rs still uses the
kitty path for the image case; flipping to the tmux-direct
path is a separate decision because AGENTS.md fact #1
claims kitty send-text is the only transport Claude's
image-paste handler reacts to. Helper is in place for the
swap when confirmed on current Claude Code build.)
Plus:
* paste.rs adds `dispatch_text_paste` — tmux `load-buffer` +
`paste-buffer -t <pane>` injection. Works in every pane
regardless of kitty focus; no clipboard claim, no unbind/
rebind dance, no kitty IPC. The text path of the new intent
decision routes here.
* In-flight tweaks bundled: clipboard-set.sh broken_flag
handling, flashpaste-logs.sh `--clip` / `--kitty` pollers
(wl-paste gated behind `--clip-wayland` to keep the dock
quiet on Mutter), inotify_watch.rs + wayland.rs cleanup.
Verified: cargo build --release clean (13 dead-code warnings,
no errors); bash -n clean on bin/wl-paste, bin/clipboard-set.sh,
bin/flashpaste-logs.sh, bin/flashpaste-screenshot-preload.sh.
Daemon restarted on the new build before this commit.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
-`rs/flashpasted/src/ipc.rs` text-vs-image intent decision in `handle_paste`. The single `latest_selection` slot still holds at most one variant (mirrors how real clipboards work), but the dispatcher now consults live X11 TARGETS too: if the daemon has a fresh staged image AND the X11 CLIPBOARD has been taken over by an external app advertising text-only targets (browser, terminal selection, IDE copy, …), the user's text is scraped, staged, and dispatched as text instead of forcing the image through. The staged image stays in memory so a subsequent paste with no text-overlay still serves it.
34
+
-`rs/flashpasted/src/paste.rs``dispatch_text_paste`: tmux `load-buffer` + `paste-buffer -t <pane>` text path. No clipboard claim, no kitty IPC, no unbind/rebind dance — pure tmux pty injection so the text lands in any pane regardless of which terminal hosts the tmux client. Replaces the "punt to bash" path for the text case.
35
+
-`rs/flashpasted/src/tmux.rs``send_ctrl_v_to_pane(pane)`: `tmux send-keys -t pane -l \x16` injects the literal Ctrl-V byte directly into the named pane's pty, bypassing kitty's "active window only" filter. Fixes the user-reported "I could paste image only into one Claude Code chat — the rest doesn't get my img."
36
+
37
+
### Fixed
38
+
39
+
-`bin/wl-paste` shim now refuses to lie. `xclip -selection clipboard -t image/png -o` on a text-only clipboard *silently returns the text bytes* instead of failing (xclip falls back to whatever's in the selection when the requested MIME isn't advertised). The shim was forwarding that text-as-image lie up to Claude Code, which would report "no image found" while pasting raw text into the chat. New behaviour: when a MIME-typed target is requested, the shim probes TARGETS first; if the requested mime isn't on offer, exit 1 with no stdout — matching what a healthy `wl-paste -t image/png` does on a missing MIME.
40
+
-`rs/flashpasted/src/ipc.rs` removed the `clipboard_holds_user_text` punt-to-bash short-circuit at the top of `handle_paste`. It was firing on every tmux highlight (which auto-copies via `@clip` to xclip), forcing Claude pastes to deliver highlighted log junk instead of the user's screenshot. The new intent decision (above) handles the same case more precisely — it only honours external text when X11 is actually owned by another app, not when xclip is briefly text-typed by our own pipe.
41
+
42
+
### Changed
43
+
44
+
-`bin/clipboard-set.sh`, `bin/flashpaste-logs.sh`, `bin/flashpaste-screenshot-preload.sh`, `rs/flashpasted/src/{inotify_watch,wayland}.rs`: in-flight tweaks bundled with the release. Notable: clipboard-set.sh gates `wl-copy` behind `FLASHPASTE_USE_WL_COPY=1` and reaps stale `wl-broken` flags; flashpaste-logs.sh adds `--clip` / `--kitty` poller streams with the wl-paste call gated behind `--clip-wayland` to keep the dock quiet on Mutter.
0 commit comments