Skip to content

fix: honor mouse capture config in terminal attach - #2995

Merged
ogulcancelik merged 1 commit into
masterfrom
akbash/2992-direct-attach-mouse-capture
Aug 19, 2026
Merged

fix: honor mouse capture config in terminal attach#2995
ogulcancelik merged 1 commit into
masterfrom
akbash/2992-direct-attach-mouse-capture

Conversation

@akbash-bot

Copy link
Copy Markdown
Collaborator

Issue

A user disables mouse capture and directly attaches to one terminal, but Herdr still takes the mouse. Native click-drag selection therefore does nothing in that attach window.

Problem

Direct attach always enabled outer-terminal mouse reporting during startup instead of applying the local mouse-capture preference. The attach client then received pointer events that the host terminal needed for native selection, even though the user had explicitly opted out.

How did we fix it?

Direct attach now applies the same already-loaded local mouse-capture preference when it initializes the host terminal. This extends the existing configuration mechanism to the one-terminal attach surface only; the default remains captured, and later mouse-mode requests from the attached terminal keep their existing behavior.

Verification

Before the change, the real direct-attach PTY path emitted CSI ?1000h with mouse_capture = false. After the change, a fresh direct attach emitted no mouse-enable modes for the false setting and retained all existing modes for a true-setting control; detach still emitted terminal teardown.

The focused direct-attach integration regression and seven attach input/scroll tests pass. Formatting and clippy pass. The broad suite passes 3,479 tests when excluding one unrelated live-handoff harness test whose checkout-path PID matcher cannot recognize this Kennel job's externally located CARGO_TARGET_DIR; the full just check reaches that same infrastructure-only failure.

refs #2992

@kangal-bot kangal-bot added the ai-review Trigger automated AI reviews for pull requests admitted by the PR gate label Aug 19, 2026
@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 063dc2b9-5cd5-4ab1-a977-840e9ff63e22

📥 Commits

Reviewing files that changed from the base of the PR and between 5203a5d and b747182.

📒 Files selected for processing (2)
  • src/client/mod.rs
  • tests/client_mode.rs

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

Direct terminal attachment now respects ui.mouse_capture. The client-spawn test helper accepts custom arguments. Integration coverage verifies mouse-reporting behavior when mouse capture is disabled and enabled.

Changes

Direct attach mouse capture

Layer / File(s) Summary
Pass configured mouse capture to terminal setup
src/client/mod.rs
setup_direct_attach_terminal accepts a mouse capture flag and receives ui.mouse_capture from run_client_with_mode.
Validate configured mouse capture behavior
tests/client_mode.rs
The process-spawn helper accepts custom arguments. The integration test verifies mouse-reporting sequences for both configuration states.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to b7471

Direct terminal attach now honors the configured mouse-capture preference while preserving enabled-mode behavior and teardown; no actionable merge-blocking risk remains after normal checks and review.

Possibly related issues

Possibly related PRs

  • herdrdev/herdr#2285 — Both changes modify terminal mouse-capture handling in src/client/mod.rs.
  • herdrdev/herdr#2523 — Both changes concern mouse-capture handling in src/client/mod.rs, although that PR covers broader graphics and pixel-mouse negotiation.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the mouse capture configuration fix, its scope, and verification results.
Title check ✅ Passed The title clearly and concisely identifies the main change: honoring the mouse capture configuration during terminal attach.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch akbash/2992-direct-attach-mouse-capture

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ogulcancelik
ogulcancelik merged commit 1b56601 into master Aug 19, 2026
7 checks passed
@kangal-bot kangal-bot removed the ai-review Trigger automated AI reviews for pull requests admitted by the PR gate label Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants