Skip to content

V2 regression: Enter during CJK IME composition submits in review panel #35746

Closed as not planned

Description

@hoshiumiarata

Description

When using a CJK IME in OpenCode v1.17.14, pressing Enter to confirm an IME candidate is treated as a submit action in the V2 review panel.

This looks like a regression of the IME handling issue reported before in #16360.

Expected: Enter during IME composition should only confirm the IME candidate and keep the review panel input open.

Actual: the review panel input is submitted immediately.

This may need the same kind of guard as before: ignore submit handling when event.isComposing is true, and possibly also handle the Safari legacy case event.keyCode === 229.

Plugins

No response

OpenCode version

v1.17.14

Steps to reproduce

  1. Open OpenCode V2.
  2. Trigger or open the review panel.
  3. Focus the review panel input.
  4. Enable a CJK IME, for example Japanese.
  5. Start typing so IME composition begins.
  6. Press Enter to confirm the IME candidate.

Screenshot and/or share link

No response

Operating System

macOS 26.5.1

Terminal

No response

Activity

  1. powoct commented on Jul 24, 2026

    @powoct

    I hit the same thing in Safari with the web app prompt input (packages/app/src/components/prompt-input.tsx), and the existing isImeComposing guard can't catch it there because of Safari's event order:

    Chrome:  keydown(Enter, isComposing=true, keyCode=229) -> compositionend   guard works
    Safari:  compositionend -> keydown(Enter, isComposing=false, keyCode=13)   all three conditions fail
    

    Safari fires compositionend before the confirming Enter keydown, so checking event.isComposing / keyCode === 229 alone isn't enough there — the guard also needs a short time window after compositionend (comparing event.timeStamp, which shares the same time origin as keydown).

    Safari has a second related problem where the composition itself gets aborted mid-input; I filed that separately as #38674.

    I'd like to work on this. Plan: add the timeStamp-based guard to the app prompt input, and for the v2 input feed the same logic into the composing flag in interaction.ts so machine.ts stays a pure state machine.

    Environment: macOS Safari, Japanese IME and Chinese pinyin.

  2. github-actions commented on Sep 24, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions