fix(renderer): disable mouse tracking on destroy#515
fix(renderer): disable mouse tracking on destroy#515simonklee merged 1 commit intoanomalyco:mainfrom
Conversation
|
Interesting. Just out of curiosity, do you know in what edge cases that would happen? I wonder because other states might be out of sync then as well. |
No specific repro beyond #509, but the class of edge cases is 'write didn't reach the TTY.' errors are swallowed, so if stdout is closed/piped or a write fails, the terminal can still be in mouse mode while state says false. This just sends a best‑effort disable before teardown. Other state flags could drift under the same failure mode, but i haven't looked into it extensively. |
|
Got it. But the native teardown is called always, so it could just unconditionally disable mouse? |
Let me go through the call paths again to make sure i understand it. |
@opentui/core
@opentui/react
@opentui/solid
@opentui/core-darwin-arm64
@opentui/core-darwin-x64
@opentui/core-linux-arm64
@opentui/core-linux-x64
@opentui/core-win32-arm64
@opentui/core-win32-x64
commit: |
|
hey! found this while tracking and figuring a mouse escape sequence issue in opencode. noticed the fix checks mouse movements also leak escape sequences after exit, so maybe just call disableMouse() unconditionally? - if (this._useMouse) {
- this.disableMouse()
- }
+ this.disableMouse()also looks like this is in draft - any plans to move it forward? 😄 |
51f08c3 to
dab23e5
Compare
dab23e5 to
e97726d
Compare
Best-effort mouse cleanup now lives in native terminal shutdown instead of TypeScript destroy state. Track whether mouse was ever enabled so teardown still emits disable sequences after state drift, while skipping unnecessary resets when mouse was never active.# Please enter the commit message for your changes. Fixes: anomalyco#509
e97726d to
96d681e
Compare
The destroy path was not explicitly disabling mouse tracking before tearing down native resources.
Best-effort mouse cleanup now lives in native terminal shutdown instead of
TypeScript destroy state. Track whether mouse was ever enabled so teardown
still emits disable sequences after state drift, while skipping unnecessary
resets when mouse was never active.# Please enter the commit message for your
changes.
Fixes: #509