[PR #515] fix(renderer): disable mouse tracking on destroy #1367

Open
opened 2026-03-14 09:33:03 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/515
Author: @simonklee
Created: 1/12/2026
Status: 🔄 Open

Base: mainHead: destroy-disable-mouse


📝 Commits (2)

  • 193cc09 fix(renderer): disable mouse tracking on destroy
  • 0970a24 Merge branch 'main' into destroy-disable-mouse

📊 Changes

2 files changed (+19 additions, -0 deletions)

View changed files

📝 packages/core/src/renderer.ts (+5 -0)
📝 packages/core/src/tests/renderer.useMouse.test.ts (+14 -0)

📄 Description

The destroy path was not explicitly disabling mouse tracking before tearing down native resources. While the zig-side
performShutdownSequence() checks terminal.state.mouse, this relies on state synchronization that can fail silently in edge cases.

Add explicit disableMouse() call in finalizeDestroy(), same as we do in suspend(), to send disable mouse escape sequence to the terminal before the renderer is freed.

Fixes: #509


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opentui/pull/515 **Author:** [@simonklee](https://github.com/simonklee) **Created:** 1/12/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `destroy-disable-mouse` --- ### 📝 Commits (2) - [`193cc09`](https://github.com/anomalyco/opentui/commit/193cc094c71bc336c84faf96618cb1eab0f2755a) fix(renderer): disable mouse tracking on destroy - [`0970a24`](https://github.com/anomalyco/opentui/commit/0970a249dafc65e849096f133eaba05323afb49b) Merge branch 'main' into destroy-disable-mouse ### 📊 Changes **2 files changed** (+19 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/renderer.ts` (+5 -0) 📝 `packages/core/src/tests/renderer.useMouse.test.ts` (+14 -0) </details> ### 📄 Description The destroy path was not explicitly disabling mouse tracking before tearing down native resources. While the zig-side performShutdownSequence() checks terminal.state.mouse, this relies on state synchronization that can fail silently in edge cases. Add explicit disableMouse() call in finalizeDestroy(), same as we do in suspend(), to send disable mouse escape sequence to the terminal before the renderer is freed. Fixes: #509 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#1367
No description provided.