Skip to content

fix: Guard focus management during mouse drag to protect text selection#45

Merged
eyelock merged 1 commit into
mainfrom
fix/focus-during-mouse-drag
Jan 16, 2026
Merged

fix: Guard focus management during mouse drag to protect text selection#45
eyelock merged 1 commit into
mainfrom
fix/focus-during-mouse-drag

Conversation

@eyelock
Copy link
Copy Markdown
Owner

@eyelock eyelock commented Jan 16, 2026

Summary

  • Prevent focus management from interrupting text selection during mouse drag
  • Track mouse drag state in TerminalSessionManager
  • Guard focus calls in updateNSView and session restoration to skip during drag
  • Fixes issue where selecting text would be interrupted by automatic focus management

Test plan

  • Open a terminal
  • Select text by clicking and dragging
  • Verify selection is not interrupted
  • Verify focus still works correctly when clicking/typing

🤖 Generated with Claude Code

Add defensive fixes to prevent intermittent loss of text selection
capability in terminals:

- Add isMouseDragInProgress flag to TerminalSessionManager
- Set flag on mouse down in terminal, clear on mouse up
- Guard focus stealing in getOrCreateSession and updateNSView
- Clear flag on cleanup to handle edge cases

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@eyelock eyelock merged commit 3403576 into main Jan 16, 2026
5 checks passed
@eyelock eyelock deleted the fix/focus-during-mouse-drag branch January 16, 2026 13:41
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.

1 participant