Skip to content

fix: make Kimi statusline work on Windows - #32

Open
bytehello wants to merge 1 commit into
stormzhang:mainfrom
bytehello:fix/kimi-windows-statusline-command
Open

bytehello wants to merge 1 commit into
stormzhang:mainfrom
bytehello:fix/kimi-windows-statusline-command

Conversation

@bytehello

Copy link
Copy Markdown

问题

Kimi Code 在 Windows 上通过 cmd.exe /d /s /c 启动 statusline 命令。复用 Claude Code 的命令构造器会给 Python 和脚本路径加内层双引号,Kimi 的 Node spawn 会将这些引号转义成字面量,导致默认安装路径下命令无法执行。

修复

  • 为 Kimi 单独构造 Windows 命令:转换为正斜杠,并在默认无空格路径下不添加双引号
  • 保持 Claude Code / Codex 的现有引号行为不变
  • 增加 Windows 命令回归测试

Closes #29

验证

  • pytest tests/test_hooks.py -q:71 passed
  • pytest -q -k 'not test_alive_pids_own_process_and_start_time_guard':其余 344 passed
  • ruff check .:passed
  • mypy src/token_tracker:passed

完整测试在当前 macOS 环境有 1 个与本次改动无关的既有失败:tests/test_sidebar.py::test_alive_pids_own_process_and_start_time_guard,该测试依赖本机进程启动时间探测;本次仅改动 hooks.py 及其测试。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kimi Code statusline 在 Windows 上不生效:_build_cc_command 的双引号与 Kimi 的 cmd.exe spawn 转义冲突

1 participant