Skip to content

Windows bash detection fails when git comes from a native MSYS2 environment (ucrt64/clang64/clangarm64) #1579

Description

@wszqkzqk

What version of Kimi Code is running?

0.23.5

Which open platform/subscription were you using?

Kimi Code

Which model were you using?

kimi-for-coding

What platform is your computer?

No response

What issue are you seeing?

On Windows, starting kimi-code fails with:

Git Bash was not found on this Windows host. Install Git for Windows
from https://gitforwindows.org/ or set KIMI_SHELL_PATH to a bash.exe.
Checked: ...

This happens on hosts where git comes from a native MSYS2 mingw-w64
package instead of msys's git, even though bash exists at
C:\msys64\usr\bin\bash.exe.

Root cause: the shell probe infers the install root from
git --exec-path by scanning the path for known prefix segments, but
only mingw32/mingw64 are recognised — the prefixes Git for Windows
still uses, but which MSYS2 upstream has deprecated. Modern MSYS2
toolchains live under ucrt64 (the default MSYSTEM), clang64, and
clangarm64
, so a native git's exec path matches nothing and the root
cannot be inferred. Setting KIMI_SHELL_PATH works around it, but
auto-detection fails before any session starts, so session id and
context usage don't apply.

What steps can reproduce the bug?

  1. Windows host with MSYS2 installed at the default C:\msys64.
  2. pacman -S mingw-w64-ucrt-x86_64-git, and put
    C:\msys64\ucrt64\bin on PATH (do NOT install Git for Windows).
  3. git --exec-path prints C:/msys64/ucrt64/libexec/git-core.
  4. Launch kimi-code.

What is the expected behavior?

Expected: detection resolves C:\msys64\usr\bin\bash.exe from the
git exec path. Actual: KaosShellNotFoundError as above.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions