feat(zerocode): make terminal copy/paste work the way users expect#7
Open
JordanTheJet wants to merge 2 commits into
Open
feat(zerocode): make terminal copy/paste work the way users expect#7JordanTheJet wants to merge 2 commits into
JordanTheJet wants to merge 2 commits into
Conversation
* ci(clawpatch): review every PR with zeroclaw as the brain Adds a GitHub Actions workflow that, on each PR, installs the prebuilt zeroclaw binary + acpx, points acpx at `zeroclaw acp` (stdio ACP), and runs `clawpatch ci` with provider=acpx so changed code is reviewed by ZeroClaw's own coding agent (Claude-backed). Non-blocking; findings post to the job summary + an artifact. Requires the ANTHROPIC_OAUTH_TOKEN repo secret. * ci: daily auto-sync fork master with upstream zeroclaw-labs/zeroclaw
Mouse capture is enabled by default, which hijacks the terminal's own click-drag selection — so users could not select/copy text with the mouse, and Ctrl+V tried the clipboard *image* before text, adding latency and surprise on the common text path. - Add a global "selection mode" toggle (Ctrl+O) that turns terminal mouse capture off and on at runtime. With it off, the terminal handles native drag-select, copy, and paste; a status-bar banner shows the mode and the exit key, read from the resolved keymap so a rebind stays accurate. The banner falls back to a compact form (leading with the exit key) when the connection status crowds the column, so the exit hint is never clipped. - Make Ctrl+V paste text-first, falling back to image attachment only when the clipboard holds no text. This also skips the per-paste image-tool subprocess on the common path, and complements bracketed paste. When a clipboard carries both text and an image the text wins; attach such an image via /attach or the Ctrl+A file browser. - Surface both affordances in the help modal: the selection-mode key and the Shift+drag native-selection hint most terminals support.
singlerider
pushed a commit
that referenced
this pull request
Jun 23, 2026
…roclaw-labs#7688) (zeroclaw-labs#8041) - 20400f8 test(runtime): pin hook panic recovery + cancellation propagation (#7… - 761bf86 ci: re-trigger Quality Gate on zeroclaw-labs#8041 - 18853a9 Merge branch 'master' into fix/issue-7688-hook-panic-recovery
singlerider
added a commit
that referenced
this pull request
Jun 27, 2026
…uzzySelect The bug-1 fix (FuzzySelect rewinds the cursor past its painted block and erases scrollback above the menu, worst on double-width CJK) was applied to run_onboard_tree/CliSurface but NOT to run_quickstart_cli, the handler behind `zeroclaw quickstart` — the very command the onboard deprecation notice steers users toward. That path was a separate hand-rolled flow still calling raw FuzzySelect::new() on all 12 menu pickers, with no theme and a raw Password for secret entry, so the cursor-erase (#1), missing styling (#7), and secret-repaint (#8) defects shipped live there while the driver guard only exercised the fixed onboard tree. Extract the theme and a themed Select helper (onboard_select / onboard_select_default) to module scope, reuse them from CliSurface (removing the duplicate inline theme/select), and convert every run_quickstart_cli picker plus the shared prompt_for_field enum picker and pick_preset to onboard_select. Each row is fit to one terminal line via fit_select_item so the 1-row-per-item clear arithmetic holds at any width and locale. Secret entry already routed through the in-place masked_secret. No FuzzySelect remains in the onboard/quickstart flow; the only one left is the config-set model-id catalog picker, where fuzzy filter over a long model list is intentional. Bin builds with onboard; fmt + clippy clean; onboard suite 47 green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
masterzerocodeTUI, mouse capture is enabled by default, which hijacks the terminal's own click-drag selection — so users could not select/copy text with the mouse — andCtrl+Vtried the clipboard image before text, adding a per-paste subprocess and surprising behavior on the common text path.Ctrl+O) that turns terminal mouse capture off/on at runtime. With it off, the terminal handles native drag-select, copy, and paste; a status-bar banner shows the mode and the exit key (read from the resolved keymap so a rebind stays accurate), and falls back to a compact form that leads with the exit key when the connection status crowds the column.Ctrl+Vpaste text-first, falling back to image attachment only when the clipboard holds no text — skipping the image-tool subprocess on the common path and complementing bracketed paste.y/ Ctrl+Shift+C), bracketed-paste handling, or the startup mouse-capture default. No agent-switching changes (separate PR).apps/zerocode(TUI client): app event loop (app.rs), a newconfig_manager::set_mouse_captureterminal helper, the input-bar paste path, and one newGlobalAction. The toggle is loop-local state; capture state persists correctly across reconnect and is unconditionally disabled on exit byrestore_terminal.apps/zerocode; suggestenhancement,size: S,risk: medium(touchesapps/zerocode/src/**).Validation Evidence (required)
cargo fmt --all -- --check cargo clippy --all-targets -- -D warnings cargo testcargo fmt --all -- --check→ clean, no diff (exit 0).cargo clippy --all-targets -- -D warnings→Finishedwith no warnings (exit 0).cargo test→ 0 failures across the workspace (grep -c "test result: FAILED"→0). Thezerocodepackage:test result: ok. 348 passed; 0 failed; 0 ignoredandok. 111 passed; 0 failed.Ctrl+Ois a free global chord (no pane/input-bar binding), handled before pane dispatch and not gated on text-input, so it works from any pane and never reaches a pane handler. Confirmed the banner readsresolved_bindings()(rebind-accurate, matching the help modal) and compacts whenleft_area.widthis below the full banner width. Verified text-first paste falls through to image attach whenread_clipboard_text()returnsNone/empty (its documented contract), preserving the pure-screenshot workflow. NOT verified: behavior on every terminal emulator's Shift-drag override, and the both-flavors (text + image) clipboard case (documented tradeoff — text wins; attach images via/attachor Ctrl+A).Security & Privacy Impact (required)
NoNoNoNoYes, describe the risk and mitigation: N/A. (Paste reads the local clipboard via the same already-present platform tools; no new capability.)Compatibility (required)
YesYes— adds a new rebindable keymap actionglobal.toggle_mouse_capture(defaultCtrl+O) and new info-bar/help strings. No migration; existing configs and keybinding overrides are unaffected, andCtrl+Owas previously unbound.NoorYesto either: exact upgrade steps for existing users: None — additive and active by default. Note one intentional behavior change:Ctrl+Vnow prefers clipboard text over a clipboard image.Rollback (required for
risk: mediumandrisk: high)Low blast radius (single TUI binary).
git revert <sha>cleanly removes the toggle, the banner, theset_mouse_capturehelper, and the text-first paste change; mouse capture reverts to always-on andCtrl+Vto image-first.