Windows 自定义 Git 安装目录下误选 WSL Bash(fork 已修复,申请贡献上游)
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 65/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- git, shell, typescript
调研方向
The issue is about shell detection in a Windows environment with Git for Windows and WSL. Look at the getShellConfig() function in the codebase. The fix involves prioritizing the Git Bash executable over the WSL bash.exe when both are in PATH. Review the linked fork PRs #1 and #2 to understand the changes. Test the fix on a Windows system with custom Git installation and WSL to ensure it selects the correct shell.
由索引模型根据 Issue 内容生成。
描述
What happened?(问题现象)
Windows 上,Git for Windows 安装在非默认目录且 git.exe 已在 PATH 中时,Step 的 shell 探测仍可能选中 C:\Windows\System32\bash.exe,导致命令进入 WSL,无法直接使用 Windows 的 Node/npm 等工具。另复现了 Git Bash 后台命令继承日志文件描述符后退出码为 1、日志为空的问题。
Steps to reproduce(复现步骤)
- 将 Git for Windows 安装在自定义目录,把其 cmd 目录加入 PATH。
- PATH 同时包含带 WSL bash.exe 的 Windows System32;不配置 shellPath。
- 调用源码中的 getShellConfig(),结果选中 WSL 启动器,而不是该 Git 安装内的 Bash。
复现直接调用核心解析函数,不加载扩展;尚未执行模板要求的交互式 pi -ne 检查。
Expected behavior(预期行为)
自动发现原生 Git Bash,避免静默切换到 WSL;保留通过 shellPath 显式选择 WSL 的能力。
Version(版本)
复现源码基线:cb5fc1456d49d49c62e072bfed2926220083214e。
已完成修复与验证
修复已合并到个人 fork:PR #1、PR #2。包含 Git Bash 发现、后台日志传输修复,以及显式 WSL 配置和 Unix 回归测试。
Ubuntu 24.04(WSL2)、Node 22.23.2 下构建、检查及完整 test.sh 通过;Windows 最后一次定向验证 30 项通过。
Windows 全量验证还发现基线中的两个独立阻断:execFileSync("npm", ...) 报 ENOENT,以及配置迁移用 file.split("/").pop() || file.split("\").pop() 提取文件名时未正确处理反斜杠路径。这两处尚未修复,建议另行处理。
希望将上述已完成的 shell 修复贡献上游,请维护者确认范围是否合适,并按贡献流程给予提交 PR 的许可。
- 主要语言
- TypeScript
- 星标
- 54
- 派生
- 20
- 平均合并
- 23 分钟
- 30 天内合并 PR
- 7
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
stepfun-ai/Step-Code 的其他 Issue
-
untriaged
难度 2/5 1-3 小时 新手友好度 75/100
stepfun-ai/Step-Code#153 · 2 条评论 ·
-
untriaged
难度 2/5 1-3 小时 新手友好度 75/100
stepfun-ai/Step-Code#151 · 1 条评论 ·
-
untriaged
难度 2/5 1-3 小时 新手友好度 75/100
stepfun-ai/Step-Code#149 · 1 条评论 ·
-
untriaged
难度 2/5 1-3 小时 新手友好度 70/100
stepfun-ai/Step-Code#148 · 1 条评论 ·
-
untriaged
难度 1/5 1 小时以内 新手友好度 90/100
stepfun-ai/Step-Code#144 · 1 条评论 ·
查看 stepfun-ai/Step-Code 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
mksglu/context-mode#1200 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
难度 2/5 1-3 小时 新手友好度 75/100
anthropics/claude-code#96687 ·
-
good first issue
难度 1/5 1 小时以内 新手友好度 95/100
AOSSIE-Org/DebateAI#582 · 2 条评论 ·