Skip to content

fix(tui): prevent mouse movement events from corrupting input on Windows#500

Merged
dwash96 merged 7 commits intocecli-dev:v0.99.9from
szmania:cli-14-tui-keyboard-mouse-capture
Apr 30, 2026
Merged

fix(tui): prevent mouse movement events from corrupting input on Windows#500
dwash96 merged 7 commits intocecli-dev:v0.99.9from
szmania:cli-14-tui-keyboard-mouse-capture

Conversation

@szmania
Copy link
Copy Markdown

@szmania szmania commented Apr 29, 2026

This PR addresses an issue where using the TUI on Windows would cause strange characters to appear in the input prompt after several interactions. The problem was caused by mouse movement tracking signals from the terminal that were not being properly handled, resulting in ANSI escape codes being printed as text.

The fix adds an on_mouse_move event handler to the TUI application that specifically stops mouse movement events on Windows. This prevents the problematic signals from reaching the input processing while preserving all other mouse functionality including scrolling and clicking.

Changes:

  • Added on_mouse_move method in cecli/tui/app.py that calls event.stop() on Windows
  • Added comprehensive tests in tests/tui/test_app.py to verify:
    • Mouse move events are stopped on Windows
    • Mouse move events are not stopped on other platforms (Linux/macOS)

Testing:
The new tests ensure the fix works correctly on Windows without affecting the behavior on other operating systems. The tests use pytest and mock the platform system to verify the conditional logic.

Impact:

  • Windows users will no longer experience corrupted input prompts
  • All other mouse functionality (scrolling, clicking) remains intact
  • No changes to behavior on non-Windows platforms

Your Name added 7 commits April 27, 2026 21:16
Co-authored-by: cecli (openai/gemini_cli_local/gemini-2.5-pro)
Co-authored-by: cecli (openai/gemini_cli_local/gemini-2.5-pro)
Co-authored-by: cecli (openai/gemini_cli_local/gemini-2.5-pro)
@dwash96 dwash96 changed the base branch from main to v0.99.9 April 30, 2026 00:23
@dwash96 dwash96 merged commit fad6956 into cecli-dev:v0.99.9 Apr 30, 2026
12 checks passed
@dwash96 dwash96 mentioned this pull request Apr 30, 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.

2 participants