bughelp wantedterminal-inputupstreamupstream-issue-linked
Description
Summary
- The VSCode integrated terminal (backed by
xterm.js) consumes raw key events instead of the text committed by the macOS IME. - In the macime one-hand Hangul mode, keys such as
q(and the mirrored row0, 9, 8, p, o, i, ;, l, k, ,→9, 8, 7, 6, 5, 4, 3, 2, 1, 0) are remapped inside libhangul. Regular text fields receive the composed character (\u0007008, etc.), but the terminal keeps the original key because it bypasses the IME composition result. In the terminal this shows up asq→q,w→w,a→a,s→s,z→z,x→x, whereas the expected mapping isq→〈,w→〉,a→「,s→,,z→」,x→..
Reproduction Steps
- Activate macime and switch to the one-hand Hangul keyboard (
HangulInputContext(keyboard: "1hand-right")). - Open VSCode and focus the Integrated Terminal (Ctrl+` or View > Terminal).
- With the IME active, type any of the remapped left-hand keys (
q,w,a,s,z,x). - Compare the output with the same keys typed in another application (e.g., TextEdit).
Expected vs Actual
- Expected: The terminal should receive the committed Hangul character that libhangul produces for
qin one-hand mode (e.g.,\u3008). - Actual: The terminal shows the raw Latin
q, confirming it ignored the IME-composed output; only the true composition keys (e,r,t,y,u,d,f,g,h,j,c,v,b,n,m,5,6,7) yield Hangul characters in the terminal.
Environment Notes
- macOS 12.7.6 (Build 21H1320), Intel x86_64 hardware, with accessibility permissions granted to macime.
- VSCode 1.104.1 (Commit 0f0d87fa9e96c856c5212fc86db137ac0d783365, x64 build).
- One-hand Hangul layout uses
HangulKit/libhangul/hangul/hangulkeyboard.htables (project repo: https://github.com/Dev0June/macime @68190e0117f27ec541836c2fc283de9343a5b590). - One-hand English layout is handled separately via
macime/KeyMapper.swift, but this path is disabled while the Hangul context is active. - Issue reproduces only in VSCode’s xterm.js terminal (and other xterm.js hosts such as Hyper); Chrome, TextEdit, and iTerm handle the IME output correctly.