Skip to content

CJK characters overflow terminal width in TUI mode #2587

Description

@wubing-wx

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions