MoonshotAI / MoonshotAI/kimi-code
bug(tui): IME candidate window can appear away from the prompt cursor
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
What version of Kimi Code is running?
Current main (6d506380), package version 0.19.1.
What platform is your computer?
Windows 11 x64 (Microsoft Windows NT 10.0.26100.0).
What issue are you seeing?
When typing Chinese in the Kimi Code TUI, the IME candidate window can appear away from the prompt editor cursor. In the observed case, the candidate popup was shown around the right/status area of the terminal while the user was typing in the prompt input.
This makes Chinese input feel broken because the candidates are no longer visually connected to the text being composed.
What steps can reproduce the bug?
- Run Kimi Code in a Windows terminal.
- Focus the main prompt editor.
- Use a Chinese IME and type pinyin, for example
ni'shi'shui. - Check where the IME candidate window appears.
Actual result: the candidate window may be anchored away from the prompt editor cursor.
Expected result: the candidate window should follow the prompt editor cursor.
Additional information
This appears to be related to hardware cursor visibility in the terminal UI. @earendil-works/pi-tui already has support for this through showHardwareCursor, setShowHardwareCursor(...), and the PI_HARDWARE_CURSOR=1 environment variable.
Kimi Code currently creates the TUI without exposing that option in tui.toml or /settings, so affected users have to discover the underlying PI_HARDWARE_CURSOR=1 workaround manually.
A first-class Kimi Code setting would make this easier to use and document, while keeping the default behavior unchanged for users who do not need it.
Suggested shape:
- Add a
tui.tomlsetting for terminal hardware cursor visibility, defaulting tofalse. - Apply it when creating the TUI.
- Re-apply it on config reload and expose it in
/settings.
Temporary workaround:
PI_HARDWARE_CURSOR=1 kimi
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating where Kimi Code creates the TUI, reloads configuration, and renders /settings, then inspect the named pi-tui APIs: showHardwareCursor, setShowHardwareCursor(...), and PI_HARDWARE_CURSOR=1. Done means a tui.toml setting defaults to false, is applied at creation and config reload, appears in /settings, and keeps the documented workaround behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 62/100