waveterm icon indicating copy to clipboard operation
waveterm copied to clipboard

change IME composing handling order to support implicitly confirming IME

Open sters opened this issue 3 weeks ago • 2 comments

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

  1. Input てすと
  2. Input Tab (or Space)
  3. IME changes the status to confirming (showing some candidates) and the text changes to テスト
  4. Input next chars like
  5. IME closes candidates for てすと
    • Expected: Confirm テスト and continue with next chars composition
    • Actual: テスト is lost, only next chars composition continues

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.

sters avatar Jan 12 '26 13:01 sters