MoonshotAI / MoonshotAI/kimi-code

[Bug] TUI Markdown rendering incomplete: only tables rendered, other elements shown as raw source

Open
#209 1 comment 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.5.0

Which open platform/subscription were you using?

Kimi Code

Which model were you using?

Kimi-k2.6

What platform is your computer?

Darwin 25.5.0 arm64 arm

What issue are you seeing?

The TUI in kimi-code has incomplete Markdown rendering support. While tables are correctly rendered with borders and alignment, other standard Markdown elements are displayed as raw source code instead of being properly formatted.

This is a regression compared to the previous Python-based kimi-cli, which used the rich library to fully render all Markdown elements in the terminal.

What steps can reproduce the bug?
  1. Open kimi-code TUI: kimi
  2. Send a message containing various Markdown elements, for example:
# Heading 1
**Bold text**
- List item 1
- List item 2

```python
print("code block")
```

| Column A | Column B |
|----------|----------|
| Cell 1   | Cell 2   |
  1. Observe the output in TUI.
What is the expected behavior?

All Markdown elements should be rendered appropriately in the terminal:

  • # Heading → Large/bold styled text
  • **bold** → Bold text
  • - list → Bulleted list with proper indentation
  • ```code``` → Syntax highlighted code block
  • | table | → Rendered table (✅ already works)
Actual Behavior
Element Rendered? Screenshot
Table ✅ Yes Correctly displayed with borders
Heading ❌ No Shows raw # Heading
Bold ❌ No Shows raw **Bold text**
List ❌ No Shows raw - List item
Code block ❌ No Shows raw ```python markers
Additional information

The previous Python-based kimi-cli used the rich library to fully render Markdown in the terminal, including:

  • Styled headings
  • Bold/italic text
  • Bulleted and numbered lists
  • Syntax highlighted code blocks
  • Tables

It would be great if kimi-code's TUI (based on pi-tui) could implement similar full Markdown rendering support, or at least not display raw Markdown syntax for unsupported elements.

Possible Solutions
  1. Integrate a full Markdown-to-terminal renderer into the TUI (similar to how rich or glow works)
  2. Pre-render Markdown before sending to TUI display layer
  3. Fallback to plain text stripping Markdown syntax for unsupported elements, rather than showing raw **, #, - markers

Thank you for considering this improvement!

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 at the kimi-code TUI display layer built on pi-tui and compare its Markdown handling with the previous Python-based kimi-cli implementation using rich. Reproduce the supplied heading, bold, list, code-block, and table example; done means non-table elements no longer appear as raw Markdown while existing table rendering remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, typescript
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.