MoonshotAI / MoonshotAI/kimi-code

TUI 流式输出被逐词折行(CJK 文本几乎无法阅读)

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

Nobody has claimed this yet.

bug
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?

0.28.0

Which open platform/subscription were you using?

openai compatible

Which model were you using?

glm-5.2

What platform is your computer?

Darwin 24.6.0 arm64 arm

What issue are you seeing?

流式渲染时,助手输出的中文/英文文本被切成"几乎每个词单独成行",一段正常的话变成竖排的词列,完全无法阅读。本条反馈消息本身在我端就被折成单词竖列——可作为现场样本。该现象间歇性出现,且在 0.28.0(最新)仍复现,因此不是旧版本遗留。

What steps can reproduce the bug?

交互模式启动 kimi

任意提问,让模型流式输出一段较长中文回复

流式过程中文本逐词折行;停止/结束后 scrollback 有时仍残留该形态

What is the expected behavior?

按真实终端宽度正常折行(CJK 按双宽计),流式与结束后渲染一致,不再出现逐词换行。

Additional information

已升级到最新(0.28.0),问题依旧 → 非版本陈旧

tui.toml 全量字段确认:无任何控制流式折行/宽度的配置项(disable_paste_burst 只管粘贴逐行提交,与此无关)→ 无可用 workaround 开关

怀疑是 TUI 流式渲染时终端宽度探测返回极小值(1~2 列)或 0,导致每个 token 立即折行;与 0.22.x 修过的"窄宽+CJK/emoji 崩溃"、以及 0.22.3 revert 的 transcript 渲染回归属同一类根因,但偶发宽度探测失败在 0.28.0 仍未根治

建议

流式渲染在拿到 width=0 / 极小值时 fallback 到 ioctl(TIOCGWINSZ) 或上次已知宽度,而非按极小宽度逐字折行

复用 0.22.x 已有的窄宽保护路径,对"宽度探测异常"也做兜底

附带诊断日志中应包含流式期间 TUI 实际生效的终端宽度采样值,便于定位

kimi-session-session_110db364-7f44-4eaa-9ca0-dc6bd8d00384.zip

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 launching interactive mode with kimi and reproducing a long streamed Chinese response. Inspect the TUI's effective terminal-width samples during streaming, including the tui.toml context and the narrow-width protection from 0.22.x. Done means streamed and completed output wrap at the real terminal width, count CJK as double-width, and avoid vertical word-by-word lines.

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
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.