Skip to content

fix(terminal): block mouse events leaking to PTY#100

Merged
TechDufus merged 3 commits into
mainfrom
fix/terminal-mouse-motion
Jan 13, 2026
Merged

fix(terminal): block mouse events leaking to PTY#100
TechDufus merged 3 commits into
mainfrom
fix/terminal-mouse-motion

Conversation

@TechDufus
Copy link
Copy Markdown
Owner

Summary

Comprehensive fix for mouse events leaking to PTY as garbage text.

Changes

  • Block all motion events immediately on entry
  • Block scroll wheel events (no scrollback buffer exists to scroll)
  • Block button clicks unless app has enabled mouse tracking
  • Preserve X10 encoding for apps that DO enable mouse tracking

Root Cause

vt10x has no scrollback buffer and apps like Claude Code don't enable mouse tracking. Forwarding mouse events as X10 sequences caused visible garbage in the input.

Note

Scrollback/scroll functionality requires implementing a scrollback buffer - tracked in #95.

Test Plan

  • Mouse movement no longer causes garbage
  • Scroll wheel no longer causes garbage
  • Clicks no longer cause garbage

Motion events (mouse movement) were leaking as X10 sequences causing
garbage text. Now explicitly blocks all motion events at entry.

- Block MouseActionMotion events immediately
- Always forward scroll wheel (apps handle internally)
- Only forward button press when mouseEnabled=true
Mouse motion, scroll, and click events were being forwarded to the PTY
as X10 escape sequences, causing garbage text in apps that don't enable
mouse tracking.

- Block motion events immediately on entry
- Block scroll wheel (no scrollback buffer exists)
- Block button clicks unless app enables mouse tracking
- Scrollback is a separate feature tracked in #95
@TechDufus TechDufus closed this Jan 13, 2026
@TechDufus TechDufus reopened this Jan 13, 2026
@TechDufus TechDufus closed this Jan 13, 2026
@TechDufus TechDufus reopened this Jan 13, 2026
Block all mouse events unless app has enabled mouse tracking.
Without tracking, X10 sequences appear as garbage text.
Scroll requires scrollback buffer (tracked in #95).
@TechDufus TechDufus merged commit d846598 into main Jan 13, 2026
3 checks passed
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