MoonshotAI / MoonshotAI/kimi-cli

macos zsh 请求抛弃青蓝色的高亮显示 || macos zsh request to discard cyan highlighting

Open
#2,319 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
11.4k
Forks
1.3k
Avg merge
9h 47m
Merged PRs (30d)
2

Description

What feature would you like to see?

问题描述

当前 theme = "dark" / "light" 只改变了 UI 框架配色(状态栏、Diff 背景、任务浏览器等),代码高亮主题是完全固定的一套,不随主题切换而变化。

这导致在浅色终端或特定视觉偏好下,默认的 cyan / bright_cyan 代码高亮非常刺眼且难以阅读。

临时 workaround

为了换掉青色,我不得不直接修改源码:

文件 修改内容
kimi_cli/utils/rich/syntax.py KIMI_ANSI_THEME 中所有 cyan / bright_cyan 替换为其他颜色(如 yellow / bright_yellow
kimi_cli/utils/rich/markdown.py _FALLBACK_STYLES 中的 markdown.codemarkdown.code_blockmarkdown.link_url 的 cyan 替换
kimi_cli/ui/shell/console.py NEUTRAL_MARKDOWN_THEME 中的 markdown.link_url 的 cyan 替换

希望官方提供一种无需改源码的方式来自定义代码高亮配色

Additional information

No response


What feature would you like to see?

Problem description

Currently theme = "dark" / "light" only changes the UI frame color (status bar, Diff background, task browser, etc.). The code highlighting theme is a completely fixed set and does not change with theme switching.

This results in the default cyan / bright_cyan code highlighting being very harsh and difficult to read in light-colored terminals or under certain visual preferences.

Temporary workaround

In order to replace the cyan color, I had to modify the source code directly:

File Modify content
kimi_cli/utils/rich/syntax.py Replace all cyan / bright_cyan in KIMI_ANSI_THEME with other colors (such as yellow / bright_yellow)
kimi_cli/utils/rich/markdown.py Replace the cyan of markdown.code, markdown.code_block, markdown.link_url in _FALLBACK_STYLES
kimi_cli/ui/shell/console.py Replace the cyan of markdown.link_url in NEUTRAL_MARKDOWN_THEME

I hope the official can provide a way to customize the code highlight color without changing the source code.

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.

Research direction

Start by reading the color definitions in kimi_cli/utils/rich/syntax.py, kimi_cli/utils/rich/markdown.py, and kimi_cli/ui/shell/console.py, including KIMI_ANSI_THEME, _FALLBACK_STYLES, and NEUTRAL_MARKDOWN_THEME. Trace how the dark/light theme is selected and identify an appropriate user-facing customization path. Done means users can change the cyan highlights without editing source files and the affected syntax and Markdown styles remain consistent.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.