[PR #781] [CLOSED] Fix delayed split SGR mouse continuation #1559

Closed
opened 2026-03-14 09:43:18 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/781
Author: @simonklee
Created: 3/5/2026
Status: Closed

Base: mainHead: repro-main-leak


📝 Commits (4)

  • b9bd096 repro
  • 49a3f35 fix: prevent delayed split SGR continuation from leaking
  • c63c972 comments
  • 412edb3 Merge branch 'main' into repro-main-leak

📊 Changes

5 files changed (+177 additions, -6 deletions)

View changed files

📝 packages/core/src/lib/parse.keypress.test.ts (+20 -0)
📝 packages/core/src/lib/parse.keypress.ts (+14 -0)
📝 packages/core/src/lib/stdin-buffer.test.ts (+29 -0)
📝 packages/core/src/lib/stdin-buffer.ts (+80 -6)
📝 packages/core/src/renderables/__tests__/Textarea.stress.test.ts (+34 -0)

📄 Description

Mouse SGR sequences can arrive split across stdin reads. In the timing path where a lone ESC is timeout-flushed and the rest of the sequence arrives later (for example [<35;20;5m), the continuation was treated as normal text and leaked into textareas.


🔄 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/781 **Author:** [@simonklee](https://github.com/simonklee) **Created:** 3/5/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `repro-main-leak` --- ### 📝 Commits (4) - [`b9bd096`](https://github.com/anomalyco/opentui/commit/b9bd0963e50f39769b17c348cf5314f987c3fb0d) repro - [`49a3f35`](https://github.com/anomalyco/opentui/commit/49a3f35c175f2e80097ea0fc6dc8ddf385e25c32) fix: prevent delayed split SGR continuation from leaking - [`c63c972`](https://github.com/anomalyco/opentui/commit/c63c972760f6db42ad362330c2d88f3e3593504d) comments - [`412edb3`](https://github.com/anomalyco/opentui/commit/412edb317f5e237d1d3d29904fb0810cf408d9ce) Merge branch 'main' into repro-main-leak ### 📊 Changes **5 files changed** (+177 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/lib/parse.keypress.test.ts` (+20 -0) 📝 `packages/core/src/lib/parse.keypress.ts` (+14 -0) 📝 `packages/core/src/lib/stdin-buffer.test.ts` (+29 -0) 📝 `packages/core/src/lib/stdin-buffer.ts` (+80 -6) 📝 `packages/core/src/renderables/__tests__/Textarea.stress.test.ts` (+34 -0) </details> ### 📄 Description Mouse SGR sequences can arrive split across stdin reads. In the timing path where a lone `ESC` is timeout-flushed and the rest of the sequence arrives later (for example `[<35;20;5m`), the continuation was treated as normal text and leaked into textareas. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-14 09:43:18 +03:00
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#1559
No description provided.