mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-24 20:45:56 +03:00
[PR #483] [CLOSED] feat(core): improve stdin-buffer emoji/IME handling with Kitty protocol #1349
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#1349
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/483
Author: @GreyElaina
Created: 1/7/2026
Status: ❌ Closed
Base:
main← Head:core-stdin-emoji-ime📝 Commits (7)
6dbb9fafeat(core): add grapheme segmentation for proper emoji/CJK handling in StdinBuffer1608669feat(core): add Kitty emoji reassembly in KeyHandlerb68c742docs(core): add Unicode spec references (UAX #29, UTS #51) to emoji helpersb0a0d66fix(core): handle surrogate edge cases and preserve polyfill errors4f580bbfeat(core): use isSingleGrapheme in parse.keypress for proper emoji/CJK detection51a8920Merge branch 'main' into core-stdin-emoji-ime09d008abun exclusive📊 Changes
8 files changed (+1011 additions, -124 deletions)
View changed files
📝
packages/core/src/lib/KeyHandler.test.ts(+157 -0)📝
packages/core/src/lib/KeyHandler.ts(+165 -11)➕
packages/core/src/lib/grapheme-segmenter.ts(+53 -0)📝
packages/core/src/lib/parse.keypress.ts(+3 -2)📝
packages/core/src/lib/stdin-buffer.test.ts(+95 -2)📝
packages/core/src/lib/stdin-buffer.ts(+70 -109)➕
packages/vue/tests/__snapshots__/layout.test.ts.snap(+183 -0)➕
packages/vue/tests/__snapshots__/textarea.test.ts.snap(+285 -0)📄 Description
Summary
Add proper grapheme segmentation and Kitty emoji reassembly for correct handling of emoji, CJK characters, and other multi-codepoint sequences.
Changes
StdinBuffer (grapheme segmentation)
grapheme-segmenter.tsusingIntl.Segmenterfor Unicode-correct text segmentationStdinBufferto emit complete grapheme clusters for non-escape inputKeyHandler (Kitty emoji reassembly)
isGraphemeExtender,canStartGraphemeCluster)KeyEvent.rawfieldArchitecture
Key insight: StdinBuffer handles grapheme segmentation for raw UTF-8 input, while KeyHandler handles emoji reassembly for Kitty protocol sequences. This separation preserves the
rawfield correctly.Supported Emoji Types
Testing
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.