Skip to content

Implement text selection for StreamingTextNode#193

Draft
Aaronontheweb wants to merge 2 commits into
devfrom
feature/text-selection
Draft

Implement text selection for StreamingTextNode#193
Aaronontheweb wants to merge 2 commits into
devfrom
feature/text-selection

Conversation

@Aaronontheweb

Copy link
Copy Markdown
Owner

Adds text selection capability to StreamingTextNode with mouse drag selection and clipboard copy.

Changes

  • Added record for tracking selection bounds
  • Added interface for routing mouse events to layout nodes
  • Implemented on with clipboard copy support
  • Added selection highlighting with reverse video decoration
  • Added method to for raw escape sequence output
  • Wired up mouse event handling in
  • Added flag for selection highlighting

Fixes #192

- Add TextSelectionState record for tracking selection bounds
- Add IMouseHandler interface for routing mouse events to layout nodes
- Implement EnableSelection() on StreamingTextNode with clipboard copy support
- Add selection highlighting with reverse video decoration
- Add SendRaw() method to IAnsiTerminal for raw escape sequence output
- Wire up mouse event handling in ReactivePage
- Add TextDecoration.Reverse flag for selection highlighting

Fixes #192
SGR mouse click events (press, release, drag) should be silently consumed
to prevent spurious ESC keypresses. Only scroll events (button 64/65)
should be emitted as MouseScrollEvent.

This fixes failing tests:
- SgrMouseClickPress_IsSilentlyConsumed
- SgrMouseClickRelease_IsSilentlyConsumed
- SgrMouseRightClick_IsSilentlyConsumed
- MultipleClicks_AllSilentlyConsumed
- ClickThenScroll_ClickConsumed_ScrollEmitted
- AfterConsumedMouseEvent_RegularKeysWorkNormally
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.

Unable to select and copy arbitrary text from chat terminal

1 participant