MoonshotAI / MoonshotAI/kimi-code

install.sh 因用户名包含 fish,向 .zshrc 写入了 fish_add_path

Open Beginner friendly
#1,834 0 comments 1 reaction 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.26.0

Which open platform/subscription were you using?

Kimi Code (OAuth)

Which model were you using?

K3 thinking

What platform is your computer?

Darwin 25.5.0 arm64 arm

What issue are you seeing?

我的 shell 是 zsh,但安装器向 ~/.zshrc 写入了 Fish 专用命令:

fish_add_path -g "/Users/fish2lab/.kimi-code/bin"

导致启动 zsh 时出现:

zsh: command not found: fish_add_path

原因有点特殊:我的用户名是 fish2lab。安装器似乎把路径中的 fish 当成了 shell 类型

What steps can reproduce the bug?

当前脚本先正确得到:

rc="/Users/fish2lab/.zshrc"

随后使用完整路径判断是否为 Fish:

if [[ "$rc" == *fish* ]]; then
  export_line="fish_add_path ..."
fi

因为 $HOME 中包含 fish,条件误命中。

What is the expected behavior?

No response

Additional information

请直接根据 $SHELL 或已经检测出的 shell_name 选择 PATH 语法,不要匹配 rc 文件的完整路径:

if [ "$shell_name" = "fish" ]; then
  export_line="fish_add_path ..."
else
  export_line="export PATH=\"${KIMI_INSTALL_DIR}/bin:\$PATH\""
fi

建议增加一个回归测试:SHELL=/bin/zsh$HOME 路径包含 fish

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 in install.sh, where the rc path is checked to choose the PATH command. Reproduce with SHELL=/bin/zsh and a HOME path containing “fish”, then verify that shell detection uses the shell name rather than the full rc path. Add or update a regression test for this case and confirm that zsh receives valid syntax while Fish still receives fish_add_path.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash
Domain
cli, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.