fix: detect Scoop Git Bash on Windows (#529)

* fix: detect Scoop Git Bash on Windows

* fix: harden Git Bash shim detection

* fix(kaos): preserve Git Bash PATH priority
This commit is contained in:
7Sageer 2026-06-08 14:00:11 +08:00 committed by GitHub
parent 9aba465fd8
commit 3b62b123e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 292 additions and 45 deletions

View file

@ -155,13 +155,13 @@ The CLI also reads several standard system variables to detect the runtime envir
- `HOME`: used to resolve the default data path
- `VISUAL`, `EDITOR`: external editor command (`VISUAL` takes precedence)
- `PATH`: used to locate dependencies such as `rg` and `git`
- `PATH`: used to locate dependencies such as `rg` and `git`; on Windows, Git Bash detection checks each `git.exe` found on `PATH`, including package-manager shims such as Scoop
- `NO_COLOR`, `FORCE_COLOR`: control color output (following the [no-color.org](https://no-color.org) convention)
- `CI`: when non-empty and not `"0"`, disables theme detection and falls back to the dark theme
- `TERM_PROGRAM`, `TERM`, `TMUX`: detect terminal features and notification support
- `DISPLAY`, `WAYLAND_DISPLAY`, `XDG_SESSION_TYPE`: detect Linux graphical sessions (for clipboard and image features)
- `WSL_DISTRO_NAME`, `WSLENV`: detect WSL for the clipboard PowerShell bridge
- `LOCALAPPDATA`: used on Windows when probing for the Git Bash installation path
- `LOCALAPPDATA`: used on Windows as a fallback when probing for the Git Bash installation path
## HTTP proxy

View file

@ -155,13 +155,13 @@ CLI 还会读取一些标准系统变量来检测运行环境,不会修改它
- `HOME`:解析默认数据路径
- `VISUAL``EDITOR`:外部编辑器命令(`VISUAL` 优先)
- `PATH`:定位 `rg``git` 等依赖
- `PATH`:定位 `rg``git` 等依赖;在 Windows 上Git Bash 探测会检查 `PATH` 中找到的每个 `git.exe`,包括 Scoop 等包管理器提供的 shim
- `NO_COLOR``FORCE_COLOR`:控制颜色输出(遵循 [no-color.org](https://no-color.org) 约定)
- `CI`:非空且非 `"0"` 时关闭主题检测,回退深色主题
- `TERM_PROGRAM``TERM``TMUX`:检测终端特性和通知支持
- `DISPLAY``WAYLAND_DISPLAY``XDG_SESSION_TYPE`:检测 Linux 图形会话(用于剪贴板和图片功能)
- `WSL_DISTRO_NAME``WSLENV`:检测 WSL用于剪贴板 PowerShell 桥接
- `LOCALAPPDATA`Windows 上探测 Git Bash 安装路径
- `LOCALAPPDATA`Windows 上探测 Git Bash 安装路径时作为 fallback 使用
## HTTP 代理