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
Description
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
- Install and switch to WeChat IME (Chinese) and confirm the candidate window appears.
- Open OpenCode desktop 2.2.5 and start a long-running agent task.
- Type pinyin in the prompt input so the candidate window opens.
- Press ESC to dismiss the candidate window.
- 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
opencodejr commented on Nov 6, 2026
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:
usrnk1 commented on Nov 6, 2026
Fix proposed in #62318. Verified with the built-in macOS Pinyin IME; WeChat IME specifically is still untested. Thanks for the report!
Metadata
Metadata
Development
No branches or pull requestsIssue actions