Skip to content

macOS engine: type_text drops a non-BMP character (an emoji) in Chromium-based apps #420

Open

Description

@SSFSKIM

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:

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

  1. How the pair is posted. Find how Keyboard.swift posts a surrogate pair:
    • one CGEvent whose unicode string is the full pair;
    • two events, one per code unit;
    • or a keycode route.
  2. 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.
  3. 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

  1. added
    bug
    status:ready-for-implementer
    priority:P3
    priority:P2
    and removed
    priority:P3
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority:P2status:ready-for-implementer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions