Repository navigation
Description
Problem
On macOS, type_text with a character outside the Basic Multilingual Plane drops that character in Chromium-based apps. An emoji is one such character: it is encoded as a UTF-16 surrogate pair. The characters around it land exactly.
This happens on cua's own keyed path (native/engine, Keyboard.swift), not the vendor runtime.
Measured in #414's hosted qualification, Chrome for Testing 157, Electron 44 default and MAWS-parity, on a password field:
- In the shape-only diagnostic run 44353014580, all 5/5 rows on main 517ab54 and on macOS engine: type_text into a password field confirms by character-count delta, emitting no count (808's rule) #414's head classified as missing. The non-BMP scalar was absent, and the surrounding ASCII was exact.
- Nothing else replaced it: no
?, no split pair, no U+FFFD, no changed neighbour. - The same non-BMP text landed exactly in Safari 27.2 on macOS engine: type_text into a password field confirms by character-count delta, emitting no count (808's rule) #414's head, so the loss is specific to Chromium's handling of the posted events.
The read-back never claims it. Plain fields answer valueMismatch, and #414's length confirmation answers lengthMismatch. But the text the agent asked for is not what the field holds.
What to find out
- How the pair is posted. Find how
Keyboard.swiftposts a surrogate pair:- one CGEvent whose unicode string is the full pair;
- two events, one per code unit;
- or a keycode route.
- What Chromium needs. Find what Chromium needs instead. Candidates:
- both units in a single keyDown/keyUp's
CGEventKeyboardSetUnicodeString; - an IME-style insert;
- a fallback to the paste route for non-BMP characters.
- both units in a single keyDown/keyUp's
- Compare with other paths. Compare with the vendor's keying and with the Linux engine (Linux type_characters for characters off the keyboard layout (keymap remapping) #226 is Linux's off-layout characters).
Check
Hosted CfT and both Electrons: type_text of an ASCII + emoji + ASCII string lands exactly, 20/20, in a plain field and in a password field. Safari, AppKit and Firefox don't regress.
Found by #414's qualification.
Activity
macOS engine: type_text pastes a text holding a character outside the…
Own native engine M5: the dispositions of gates #186, #190 and #420, …
Own native engine spec: Text carries #186's entered count, #420's Chr…
macOS engine and wrapper: a secret holding a character above U+FFFF i…
Own native engine M5: the gate dispositions after T8a's fix wave (refs …
Own native engine M5: #420's qualification recipe reads back only del…
Own native engine M5 wave 1: #420's kit cleared for hosted runs (refs #…
Own native engine M5: #420's qualification passes cua's side on every…
Own native engine M5 wave 1: #420's qualification run recorded (refs #…