anomalyco / anomalyco/opencode

[Bug] Windows Terminal: Chinese IME stops committing text in the TUI until the IME is restarted

Open
#44,655 0 comments 0 reactions 1 assignee View on GitHub

@Hona is already working on this.

Since Aug 24, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

In the TUI prompt, Chinese input works for a while after launch and then stops. The IME candidate window still opens and I can pick a candidate, but the committed text never arrives in the prompt — nothing is inserted. ASCII typing is unaffected, and the same IME keeps working normally at the plain PowerShell prompt in the same Windows Terminal tab, so this is specific to the opencode TUI.

The only thing that recovers it is tearing down the text service: toggling Settings → Time & language → Language & region → Chinese → Microsoft Pinyin → "Use previous version of Microsoft Pinyin IME" restores input immediately. Win+Space to English and back also works. Then it breaks again after some more use. Restarting opencode also buys another working period.

That recovery pattern suggests the composition state tracked in the TUI's stdin handling gets stuck, rather than anything being wrong with the IME itself.

Two things that may be relevant to scoping: I'm on an RDP session (SESSIONNAME=RDP-Tcp#0), and my console codepage is 936 (GBK), not 65001.

Also worth noting: opencode enables the kitty keyboard protocol when the terminal advertises kitty_keyboard, and there is no env var or tui.json option to turn it off, so I couldn't test whether the problem goes away without it. An escape hatch for that would help narrow this down.

#14761 is the same report from other users (four different IMEs: Microsoft Pinyin, Microsoft Wubi, Sogou Wubi, WeChat). It was auto-closed by the stale bot without a fix. Still reproduces on 1.18.21.

Plugins

opencode-mem

OpenCode version

1.18.21

Steps to reproduce
  1. Windows Terminal + PowerShell, run opencode in any project.
  2. Switch to Microsoft Pinyin, type Chinese into the prompt — works.
  3. Keep using the session for a while (send a few prompts, let responses stream).
  4. Type Chinese again — the candidate window appears, but selecting a candidate inserts nothing.
  5. Toggle "Use previous version of Microsoft Pinyin IME" (or Win+Space away and back) → input works again.
Operating System

Windows 11 Pro 25H2, build 26200.9168. Locale zh-CN, display language en-US. RDP session.

Terminal

Windows Terminal 1.24.11911.0, PowerShell 5.1, console codepage 936.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.