MoonshotAI / MoonshotAI/kimi-code

TUI: Copied multi-line text includes leading whitespace and plan | prefix

Open
#3,813 0 comments 0 reactions 1 assignee View on GitHub

@Grapedge is already working on this.

Since Sep 18, 2026.

enhancement
Dominant language
TypeScript
Stars
7.5k
Forks
1.2k
Avg merge
11h 53m
Merged PRs (30d)
350

Description

What feature would you like to see?

When using the TUI, text copied from the interface does not come out "clean":

  1. Multi-line text selection: When selecting text that spans multiple lines, the copied content includes the leading whitespace (spaces) at the beginning of each line.
  2. Plan view: When copying text from a plan, the copied content includes the | character at the beginning of each plan line.

Current behavior:

  • Copying a multi-line selection pastes with unwanted leading spaces.
  • Copying text from a plan includes the | prefix on each line

Example:

Image

copy result:

Try Kimi Code Web UI - clearer task progress, visual sessions & settings management
   Run /web to continue your session in the browser
Image

copy result:

根因:TUI 基于 packages/pi-tui 的预换行架构,组件在 render(width) 里就把换行和缩进物化成空格写进终端输出,终端原 │
   │ 生选区只能拷贝屏幕上的字符。缩进注入点遍布各处(banner.ts:50-85、assistant-message.ts:118-127、                  │
   │ packages/pi-tui/src/components/markdown.ts:866、全局 gutter),逐个改渲染不现实且会破坏排版。                    │
   │                                                                                                                  │
   │ 用户已确

Expected behaviour: copied message is clean text without blackspace and |

Additional information

No response

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.