You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Non-BMP characters (emoji, some symbols) typed or pasted on Windows produce no event. BMP input works fine. #40
KEY_EVENT_RECORD.UnicodeChar is a UTF-16 code unit, so an emoji arrives as two consecutive KEY_EVENTs (leading + trailing surrogate). The guard in windows.zig:
if (unicode_char > 0 and unicode_char < 0xD800) { ... }
rejects both halves, so the character is lost. conhost pairs surrogates it self before handing records to the app; a library reading raw KEY_EVENTs has to do the same (Microsoft's _leadingSurrogate in terminalInput.cpp).
Ran into this while building a TUI on zigtui — the emoji picker (Win+.) and pasting an emoji into the input field both produce nothing. crossterm hit the same thing: crossterm-rs/crossterm#1072
I'm preparing a PR for this, will send it shortly.
After fixing this I found another, separate bug: TextInput stores wide characters (CJK, emoji) correctly but renders them as blanks - the field is empty while the Buffer line below shows the full text.
render() advances one column per code point, so the next glyph is written into the trailing cell of a wide character and the cell buffer clears the pair. Counting display columns via codepointWidth fixes it.
Activity
NeonMedusa commentedon Sep 20, 2026
After fixing this I found another, separate bug: TextInput stores wide characters (CJK, emoji) correctly but renders them as blanks - the field is empty while the Buffer line below shows the full text.
render() advances one column per code point, so the next glyph is written into the trailing cell of a wide character and the cell buffer clears the pair. Counting display columns via codepointWidth fixes it.
Now part of #42 along with the input fix.
windows: combine UTF-16 surrogate pairs for non-BMP input