-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Japanese IME composition duplicated when eisuu key ends composition #5778
Copy link
Copy link
Open
Description
When using the Japanese IME on macOS, ending composition by pressing the eisuu (英数) key — instead of Enter — causes the composed text to be duplicated.
This is a very common setup among Japanese Mac users: Karabiner-Elements remaps the left Command key (when pressed alone) to send japanese_eisuu, enabling quick IME toggling. This is one of the most popular Karabiner configurations in Japan.
Details
- Browser and browser version: Electron 34.x (VS Code 1.112.0)
- OS version: macOS 15 (Darwin 23.1.0, arm64)
- xterm.js version: @xterm/xterm 6.1.0-beta.191 (bundled with VS Code 1.112.0)
Steps to reproduce
- On macOS, enable the Japanese IME
- Install Karabiner-Elements and configure: left Command (alone) →
japanese_eisuu - Open VS Code's integrated terminal
- Type Japanese text (e.g. type
konnichihato compose "こんにちは") - Press left Command to confirm composition and switch to English input
Expected: "こんにちは" is committed once
Actual: "こんにちはこんにちは" — the text is duplicated
Notes
- Pressing Enter to confirm composition first, then switching input source → no duplication
- Using an external native terminal (e.g. Ghostty) → no duplication
- The issue is not specific to any particular TUI application running inside the terminal
Probable cause
In CompositionHelper.ts, when a non-229 keyCode (such as japanese_eisuu) arrives while _isComposing is true:
keydown()calls_finalizeComposition(false)— sends composed text immediately- The browser then fires
compositionend→ calls_finalizeComposition(true)— sends composed text again viasetTimeout - Both paths emit the same text, resulting in duplication
Native terminal emulators do not have this issue because they use the OS-level IME framework directly, without going through DOM composition events.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels