[PR #600] [MERGED] fix(input): set printable sequence for modifyOtherKeys chars #1430

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

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/600
Author: @simonklee
Created: 1/28/2026
Status: Merged
Merged: 1/29/2026
Merged by: @kommander

Base: mainHead: french-keyboard


📝 Commits (1)

  • 104ebbc fix(input): set printable sequence for modifyOtherKeys chars

📊 Changes

2 files changed (+20 additions, -1 deletions)

View changed files

📝 packages/core/src/lib/parse.keypress.test.ts (+14 -0)
📝 packages/core/src/lib/parse.keypress.ts (+6 -1)

📄 Description

modifyOtherKeys (CSI 27;mod;code~) currently decodes name and
modifiers but leaves sequence as the raw ESC sequence. Textarea
inserts from sequence and rejects control chars (< 32), so sequences
like ESC [27;2;49~ (Shift+1 on AZERTY in WezTerm) never insert text.

Terminals that send plain "1" take the single-byte digit path and
work.

For printable codes, set sequence to the decoded character and mark
digits as number=true. This mirrors the single-byte digit behavior, so
text insertion now sees "1" instead of ESC and passes the guard.

Raw is preserved and special keys (return/escape/tab/space/backspace)
still keep their raw sequences, so control/navigation handling does
not change.

Keybinding lookup continues to use name+modifiers, so shortcuts are
unaffected.

This addresses an issue reported in opencode https://github.com/anomalyco/opencode/issues/10577


🔄 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/600 **Author:** [@simonklee](https://github.com/simonklee) **Created:** 1/28/2026 **Status:** ✅ Merged **Merged:** 1/29/2026 **Merged by:** [@kommander](https://github.com/kommander) **Base:** `main` ← **Head:** `french-keyboard` --- ### 📝 Commits (1) - [`104ebbc`](https://github.com/anomalyco/opentui/commit/104ebbcbcabfe3fb88475bf32304a2d377d6566e) fix(input): set printable sequence for modifyOtherKeys chars ### 📊 Changes **2 files changed** (+20 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/lib/parse.keypress.test.ts` (+14 -0) 📝 `packages/core/src/lib/parse.keypress.ts` (+6 -1) </details> ### 📄 Description modifyOtherKeys (CSI 27;mod;code~) currently decodes name and modifiers but leaves sequence as the raw ESC sequence. Textarea inserts from sequence and rejects control chars (< 32), so sequences like ESC [27;2;49~ (Shift+1 on AZERTY in WezTerm) never insert text. Terminals that send plain "1" take the single-byte digit path and work. For printable codes, set sequence to the decoded character and mark digits as number=true. This mirrors the single-byte digit behavior, so text insertion now sees "1" instead of ESC and passes the guard. Raw is preserved and special keys (return/escape/tab/space/backspace) still keep their raw sequences, so control/navigation handling does not change. Keybinding lookup continues to use name+modifiers, so shortcuts are unaffected. This addresses an issue reported in opencode https://github.com/anomalyco/opencode/issues/10577 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-14 09:36: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#1430
No description provided.