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
v1.20: per-invocation logging + re-assert clipboard before each paste
Diagnosing the user-reported "right-click → Paste does nothing for
image-paste, Ctrl+V works" required two things this commit ships:
1. Per-invocation log in flashpaste-trigger
Every call appends one line to
~/.local/state/flashpaste-trigger.log (override with
FLASHPASTE_TRIGGER_LOG). Records timestamp, pid, op (paste or
stage-text), pane, phase (start / handled / exec-bash / exit), and
the daemon outcome. Combined with the daemon's journalctl
(also bumped to INFO for the punt reasons below), you can answer
"what happened when I clicked Paste at 13:47:22?" without strace.
tmux.conf.snippet now sets TMUX_PASTE_TRIGGER=right-click-menu on
the right-click path so the log distinguishes it from the
ctrl-v path the C-v binding tags. Users with their own
MouseUp3Pane menu should do the same in their Paste item.
Suppress with FLASHPASTE_QUIET=1 (matches the bash dispatcher's
FLASHPASTE_QUIET semantics).
2. Re-assert clipboard ownership before each paste (paste.rs)
Root cause of the user's symptom: between two pastes the user can
copy text. The v1.19 OSC 52 path makes kitty the live Wayland
owner with text/plain. The daemon's `latest_image` is still cached
in memory but the *live* clipboard owner has changed. When the
daemon dispatches send-text \026 and Claude calls
`wl-paste -t image/png`, kitty serves the (text) selection and
Claude reads 0 image bytes — silent no-op.
Fix: bump the stage_notifier and sleep 40 ms before dispatch. That
wakes the Wayland + X11 owner tasks; they re-claim the selection
with the staged image bytes before the kitty send-text fires. On
mutter (where wl-clipboard-rs's wlr-data-control claim is rejected
outright — separate ext-data-control TODO), the X11 re-claim still
succeeds and the wl-paste shim's xclip fallback delivers the
image to Claude.
3. Bumped DEBUG → INFO for the daemon's paste lifecycle events
`paste: request received`, `paste: dedupe …`, `paste: no staged
image`, `paste: staged image too old` are now visible at the
default RUST_LOG=info level via journalctl --user -fu flashpasted.
That was the actual show-stopper for v1.19 debugging: the user's
journalctl was silent because everything interesting was at debug.
Verified locally:
- `cargo build --release` clean (only pre-existing dead-code warnings)
- Smoke test: `flashpaste-trigger %1` writes a `start` then either
`handled :: daemon` or `exec-bash :: daemon-declined` line to
~/.local/state/flashpaste-trigger.log; journalctl shows the
matching `paste: request received` + decision.
- Daemon restarted on dev box; logs flowing as expected.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments