GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — desktop: ESC with active IME candidate window also interrupts the agent loop · Issue #62290 · anomalyco/opencode

desktop: ESC with active IME candidate window also interrupts the agent loop #62290

New issue
Copy link
New issue
Copy link
Closed
#62318
Closed
desktop: ESC with active IME candidate window also interrupts the agent loop#62290
#62318
Copy link

Description

@CapybaraLearningPython
CapybaraLearningPython
opened on Nov 6, 2026
Issue body actions

Summary

On macOS, while a Chinese IME candidate window is open, pressing ESC closes the candidate window and also interrupts the running agent loop. The keybinding settings expose no ESC entry, so it cannot be rebound or disabled, leaving no workaround.

Environment

  • opencode version: 2.2.5 (OpenCode.app, CFBundleShortVersionString)
  • OS: Darwin 27.0.0 arm64 (macOS)
  • Terminal: N/A (desktop app)
  • Shell: /bin/zsh
  • Install/channel: release app at /Applications/OpenCode.app
  • Active plugins: @slkiser/opencode-quota, [email protected]
  • Input method: WeChat IME, Chinese mode

Reproduction

  1. Install and switch to WeChat IME (Chinese) and confirm the candidate window appears.
  2. Open OpenCode desktop 2.2.5 and start a long-running agent task.
  3. Type pinyin in the prompt input so the candidate window opens.
  4. Press ESC to dismiss the candidate window.
  5. Observe the agent run state.

Expected Behavior

While a candidate window is open, ESC should be consumed by the IME and only dismiss it. The app should not receive the key, and the agent loop should keep running.

Actual Behavior

ESC dismisses the candidate window and interrupts the agent loop at the same time.

Additional Context

  • Reproduces on every attempt (100%) once the candidate window is open.
  • The settings keybinding list has no ESC entry, so it cannot be rebound or disabled; there is no workaround.
  • Likely cause: the ESC keydown is handled unconditionally at the app layer without checking IME composition state (event.isComposing / NSTextInputClient hasMarkedText). When marked text exists, the handler should return early and skip the interrupt path.
  • Impact: interrupting the agent is a frequent action for Chinese users, and the misfire cannot be avoided.

Activity

  1. opencodejr commented on Nov 6, 2026

    @opencodejr
    opencodejrBot
    on Nov 6, 2026
    Contributor
    More actions

    Thanks for the detailed report. I couldn't reproduce this here: it needs the macOS desktop app with a real Chinese input method, and this sandbox can't provide either. A maintainer with that setup will need to confirm it.

    The code does seem to match what you describe, on 2.2.5 and on the current dev branch. While the agent is running, the composer's keydown handler (packages/app/src/composer/editor/interaction.ts) treats Escape as Stop without first checking whether an IME composition is active (event.isComposing / keyCode 229). Other Escape handlers in the app, such as the question dock and rename fields, already skip composition.

    Related:

    • fix(app): keep the composer editor inert during IME composition #55295: open PR that makes the composer ignore keys during IME composition, which may also cover this
    • macOS native Chinese IME composition is not cancelled correctly when pressing Esc #37911: Esc during macOS Pinyin composition leaves the pinyin in the input
    • TUI input loses focus when pressing Esc during Chinese IME composition #28118: the same kind of problem in the TUI (Esc during Chinese IME composition)
  2. usrnk1 commented on Nov 6, 2026

    @usrnk1
    usrnk1
    on Nov 6, 2026
    Contributor
    More actions

    Fix proposed in #62318. Verified with the built-in macOS Pinyin IME; WeChat IME specifically is still untested. Thanks for the report!

  3. usrnk1
    closed this as completedin #62318on Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.