MoonshotAI / MoonshotAI/kimi-code

CJK characters overflow terminal width in TUI mode

Open
#2,587 1 comment 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

Description

kimi-code 0.31.1 TUI renders CJK (Chinese) text beyond the terminal edge. Text is not wrapped correctly — characters overflow to the right side of the terminal window and get clipped.

Environment

  • kimi-code: 0.31.1
  • OS: macOS 15.5 (Darwin 25.5.0, arm64)
  • Terminal: Ghostty (xterm-ghostty), also reproducible in other terminals
  • COLUMNS: 80
  • LANG: en_US.UTF-8
  • Font: Maple Mono NF CN (monospace with CJK support)

Steps to Reproduce

  1. Start kimi in a terminal with 80 columns
  2. Ask any question in Chinese
  3. Observe that the response text overflows the right terminal edge

Expected Behavior

CJK characters should be treated as double-width (2 terminal columns each). Text should wrap correctly within terminal width, and respond to terminal resize events — just like Claude Code does with the same Ink/React TUI framework.

Actual Behavior

Text overflows to the right, gets clipped at the terminal edge. Resizing the terminal does not fix the layout.

Reference

Claude Code (same Ink-based TUI framework) handles CJK width calculation and terminal resize correctly in the same environment. This suggests the fix is within kimi-code's rendering layer, not the terminal or framework.

Screenshots

(will attach in follow-up comment)

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 the TypeScript TUI rendering and layout code built with Ink/React, then reproduce the issue with Chinese input in an 80-column terminal. Done means CJK characters stay within the terminal width, wrap at the correct double-column width, and the layout responds correctly to terminal resizing.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.