waveterm
waveterm copied to clipboard
change IME composing handling order to support implicitly confirming IME
Problem
When using IME with Japanese in the terminal panel, implicitly confirming IME does not work properly.
Environment
- MacOS 26.2
- Wave Terminal 0.13.1 (202512170503)
- Google Japanese IME 2.32.5990
Step to reproduce
- Input
てすと - Input Tab (or Space)
- IME changes the status to confirming (showing some candidates) and the text changes to
テスト - Input next chars like
あ - IME closes candidates for
てすと-
Expected: Confirm
テストand continue with next chars composition -
Actual:
テストis lost, only next chars composition continues
-
Expected: Confirm
Cause
I added some logs and check the behavior, the event triggering order seems complicated.
- When explicitly confirming IME (Input Enter)
- compositionend -> handleTermData
- When implicitly confirming IME (Input Tab + Input next char)
- compositionend -> compositionstart -> handleTermData
DEMO
| Current | This PR | Reference (Chrome's textarea) |
|---|---|---|
Note
I'm not familiar with other CJK languages and IME itself. There may be patterns I'm unaware of.