MoonshotAI / MoonshotAI/kimi-code
[Bug] 使用 ! 命令模式时异常退出(ls | grep Agent 返回 exit code 1)
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
问题描述
在使用 ! 命令模式执行 shell 命令时,命令会被判定为失败并异常退出。
复现步骤
1. 进入命令模式,执行:
```bash
! ls | grep Agent
- 观察执行结果。
实际结果
输出如下,并提示失败退出:
$ ls | grep Agent
Process exited with code 1
Command failed with exit code: 1.
预期结果
- 当
grep未匹配到内容导致返回码为1时,不应被当作“异常”处理并中断流程。 - 或者至少应给出更清晰提示:这是“无匹配结果”而非命令执行错误。
影响
影响在 ! 模式下进行常见管道查询(尤其是 grep)的可用性与用户体验,容易误判为程序异常。
环境信息
- Repo:
MoonshotAI/kimi-code - 触发命令:
ls | grep Agent - 时间: 2026-07-21(本地)
备注
grep 在无匹配时返回 1 属于常见行为,建议在 ! 命令模式中对该类返回码做兼容处理,或提供可配置的退出码策略。
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the ! command-mode shell execution path and inspect how command exit codes are classified. Reproduce ls | grep Agent, then adjust the handling so grep's exit code 1 is treated as no match or reported clearly without aborting the flow; verify the behavior with this command.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell, typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 62/100