Repository navigation
Description
Problem & intent
On cua's own Linux engine (#171), type_text and paste into a Chrome textarea that holds a selection deliver the paste chord, then serve Chrome's CLIPBOARD request. If that read fails after the chord was delivered, Chromium treats the failure as empty text and Blink deletes the selection. cua then answers unconfirmed, which is honest, but the person's selected text is gone and the answer does not say so. The read can fail in three ways:
- Late request. The request comes after the paste's cleanup has run. cua refuses it under the late-generation rule (
clipboard/owner.rs). - Timeout. The read times out.
- Stalled INCR. An INCR transfer stalls.
The mechanism was read from cua's code and from upstream sources. It was not probed live:
- Chromium.
ClipboardOzone::ReadTextmaps a failed read to''. - Blink.
ReplaceSelectionCommanddeletes the selection for an empty fragment. - cua. cua itself never deletes text: there is no DeleteText or CutText anywhere in the engine, and every pre-dispatch refusal sends nothing.
- The other targets are safe on a failed read:
- GTK 3:
clipboard_text_receiveddeletes only on non-NULL text. - GTK 4:
paste_clipboard_finishneeds a successful read. - Gecko:
InsertTextFromTransferableneeds non-empty text. - Chrome's address bar:
OnOmniboxPasteCompleterejects empty text. - VTE: has no editable selection.
- GTK 3:
Never observed. Every Chrome paste in the M3 gate was confirmed, and M2's failure trials had no selection.
Intent: a cua paste must never cost the person their selected text. Where cua cannot prevent that, its answer must say the selection may be gone.
Seams: the Linux engine's paste and clipboard owner (clipboard/owner.rs, the late-generation rule), and the answer text of type_text and paste.
Constraints
- Preserve M2's cross-delivery rule: a late requestor is not served cua's text unless the design shows it is the paste's own requestor and no other paste can be.
- Preserve the stage answers. Diagnostics stay value-free and never record the person's text or clipboard.
- Live proof runs on the Linux VM's harness scenes, never on the person's apps.
- Spawned by Independence 4b: cua's own Linux native engine (replace sky_linux), after #117's macOS engine #171 (M3 branch review question). Parent N/A; blocked-by N/A.
Success criteria
- A probe, first. A Chrome textarea with a selection. The paste chord delivered. Chrome's conversion refused, or its INCR stalled, without an owner change. Then, after Chromium's read timeout, read back the text and the selection. Result: whether the selection is deleted.
- If it is:
- (a) The unconfirmed answer states that the selection may have been deleted, whenever cua knows the read failed after delivery (a refused late conversion, a timeout, a stalled INCR).
- (b) A design that prevents the loss, weighed against the cross-delivery rule. Candidates: serve the paste's own late requestor, identified by its window and the request's timing. Or hold the selection's restore text and re-insert it on a known failure. Each comes with its cost.
- If it is not: a Decision Log line that closes this ticket with the probe's evidence.
- The same probe against the vendor's Linux build in Chrome, recorded as a finding.
Open questions
Can the paste's own late requestor be told apart from a later paste reliably enough to serve it?
Decision log
- 2026-11-01: registered during Independence 4b: cua's own Linux native engine (replace sky_linux), after #117's macOS engine #171 M3's gate rerun, from linux171's answer to the design session. Kept out of M3: it needs a failed read after delivery, the answer is already unconfirmed, and a fix changes M2's paste design. The owner's rule: every declared gap gets a ticket.
Sources
- linux171's report to the design session, 2026-11-01 (sminos chat MAWS 3c5ca588:124).
- Related: macOS engine: a Cmd-V handled after the clipboard restore would paste the person's previous clipboard #256, the macOS counterpart: a late read after the restore pastes the person's previous clipboard.
Activity
#171 spec: the gedit buffer the pinned build emptied (task 24), the l…