MoonshotAI / MoonshotAI/kimi-code

bug(tui): IME candidate window can appear away from the prompt cursor

Open
#1,022 0 comments 0 reactions 0 assignees View on GitHub

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?
  1. Run Kimi Code in a Windows terminal.
  2. Focus the main prompt editor.
  3. Use a Chinese IME and type pinyin, for example ni'shi'shui.
  4. 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.toml setting for terminal hardware cursor visibility, defaulting to false.
  • 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

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.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.