Skip to content

Adopt quadraui TUI text-selection + OSC52 clipboard; delete bespoke clipboard/selection plumbing #508

Description

@JDonaghy

Blocked on

JDonaghy/quadraui#269tui runtime: line-wise mouse text selection + OSC52
copy via shared drag-origin dispatch
. Don't start until that lands and the new
quadraui version is pinned here.

Why

quadraui #269 adds two things to the TUI runtime that let vimcode delete a stack
of bespoke, environment-fragile code:

  1. OSC52 clipboard write in services().clipboard() — works over SSH/tmux,
    no external binary.
  2. Cross-backend selectable text regions + DragTarget::TextSelection
    drag-origin dispatch, with line-wise selection and Ctrl-C copy.

Work

1. Delete the TUI clipboard plumbing (high confidence)

  • Remove find_clipboard_write_cmd, find_clipboard_read_cmd,
    setup_tui_clipboard, tui_copy_to_clipboard (src/tui_main/mod.rs:644–771),
    plus the DISPLAY=:0 hack and the copypasta_ext-bug workaround.
  • Route writes through services().clipboard().write_text() (OSC52 + arboard).
    Reads stay native/arboard — OSC52 read is disabled in most terminals.
  • Reassess the engine.clipboard_read / engine.clipboard_write callback
    indirection — likely collapses into the quadraui service.
  • sync_tui_clipboard (yank register → system clipboard) keeps its trigger but
    writes via the service.

2. Replace integrated-terminal screen selection (medium)

  • The terminal panel's screen-cell selection + manual auto-copy-on-release
    (src/tui_main/mouse.rs:1145) maps onto quadraui's selectable-region +
    Ctrl-C/auto-copy. Register the terminal content rect as a TextRegion; drop the
    bespoke drag + auto-copy bookkeeping.

3. Route editor visual-selection drag arbitration (design needed)

  • The editor's visual selection is document-model:
    window_zone_hit_test → WindowZone::TextArea { buf_line, col } → engine.mouse_drag(window, line, col) (src/tui_main/mouse.rs:1004). Keep the
    document mapping in the engine.
  • Move the drag-origin arbitration + gesture lifecycle onto a quadraui
    DragTarget, mirroring how scrollbar drag already feeds through
    quadraui::dispatch_mouse_drag (src/tui_main/mouse.rs:51). Net: more bespoke
    mouse_text_drag bookkeeping in mouse.rs collapses.
  • Open question to settle once Phase B.5e followup — quadraui::tui::run runner (after backend lift) #269 lands: whether DragTarget::TextSelection can
    carry a consumer payload (window/line/col) or vimcode needs a thin consumer-side
    variant.

Acceptance

  • No xclip/xsel/wl-copy/pbcopy/clip.exe spawning in the vimcode TUI; copy works
    over SSH/tmux via OSC52.
  • Mouse selection in editor + terminal panels goes through quadraui dispatch;
    src/tui_main/mouse.rs and src/tui_main/mod.rs shrink.
  • Existing yank/paste and terminal copy behavior preserved.

Prereq: JDonaghy/quadraui#269

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedBlocked on a prereq (linked in body)coordTracked by coord-tui pipelineenhancementNew feature or requeststatus:readyRefined and ready to enter the work pipeline

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions