mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-25 04:55:58 +03:00
[PR #764] [MERGED] fix(mouse): honor enableMouseMovement during mouse mode enable/restore #1542
Labels
No labels
bug
core
documentation
feature
good first issue
help wanted
pull-request
question
react
solid
tmux
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/opentui#1542
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/anomalyco/opentui/pull/764
Author: @aarcamp
Created: 3/2/2026
Status: ✅ Merged
Merged: 3/2/2026
Merged by: @kommander
Base:
main← Head:fix-enable-mouse-movement📝 Commits (3)
18d2740fix(mouse): honor enableMouseMovement during mouse mode enable/restore43cd956Merge branch 'main' into fix-enable-mouse-movement3f2ad95Clean up comments in restoreTerminalModes function📊 Changes
3 files changed (+90 additions, -8 deletions)
View changed files
📝
packages/core/src/zig/renderer.zig(+2 -3)📝
packages/core/src/zig/terminal.zig(+24 -5)📝
packages/core/src/zig/tests/terminal_test.zig(+64 -0)📄 Description
Currently, the boolean
enableMouseMovementvalue is ignored as passed to the createCliRenderer() function. This change set solves the issue by carrying the setting through to the setMouseMode() routine, saving it to the mouse state, and writing the appropriate ANSI sequence to disable or enable "any-event" tracking. restoreTerminalModes() is also updated to send the right sequences.Basic unit tests are included to test the desired behaviors.
I noticed this when running an OpenTUI application on a remote server through SSH and the connection was lost while the app was running. Afterward, as soon as I moved the mouse, I saw a bunch of garbage in my terminal and iTerm2 began complaining about mouse reporting left on. I was anticipating this to happen only for mouse clicks, not mouse movement, so I kept digging until I found the missing handling.
Tested the fix with both iTerm2 Build 3.6.6 and Ghostty Version 1.2.3. I was not able to identify any existing GitHub issues covering this problem.
Test output:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.