fix: forward mouse drag events in buttonEventTracking mode#519
Open
gi11es wants to merge 3 commits into
Open
Conversation
…caza#87) mouseDragged only forwarded drag events for anyEvent mouse mode (sendMotionEvent), but tmux uses buttonEventTracking (CSI ? 1002 h) which also needs drag forwarding for pane resize and text selection. Change the guard from sendMotionEvent() to sendButtonTracking() which covers both buttonEventTracking and anyEvent modes. Add MouseTrackingTests with 14 tests covering: - MouseMode.sendButtonTracking() for all enum cases - MouseMode.sendMotionEvent() for all enum cases - Superset relationship between the two predicates - Integration tests verifying motion events are forwarded in buttonEventTracking and anyEvent modes via Terminal + delegate - Negative tests for off and vt200 modes - SGR encoding format verification Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Fixes #87
mouseDraggedonly forwarded drag events whenmouseModewas.anyEvent(viasendMotionEvent()), but tmux uses.buttonEventTracking(CSI ? 1002 h) which also requires drag event forwarding for pane resize and mouse text selection.sendMotionEvent()tosendButtonTracking(), which returnstruefor bothbuttonEventTrackingandanyEventmodes.Reproduction
Test plan
MouseTrackingTestswith 14 tests covering:MouseMode.sendButtonTracking()returns correct values for all 5 enum casesMouseMode.sendMotionEvent()returns correct values for all 5 enum casessendButtonTracking()is a superset ofsendMotionEvent()(the invariant this fix relies on)buttonEventTrackingis activeanyEventis active (regression guard)offandvt200modes do not pass thesendButtonTracking()check<32;col;row M)swift test --filter MouseTrackingTests🤖 Generated with Claude Code