Windows 自定义 Git 安装目录下误选 WSL Bash(fork 已修复,申请贡献上游)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 65/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- git, shell, typescript
- Ambito
- cli, developer-experience, tooling
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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 的许可。
- Lingua principale
- TypeScript
- Stelle
- 54
- Fork
- 20
- Merge medio
- 23m
- PR unite (30g)
- 7
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di stepfun-ai/Step-Code
-
untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
stepfun-ai/Step-Code#153 · 2 commenti ·
-
untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
stepfun-ai/Step-Code#151 · 1 commento ·
-
untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
stepfun-ai/Step-Code#149 · 1 commento ·
-
untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
stepfun-ai/Step-Code#148 · 1 commento ·
-
untriaged
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
stepfun-ai/Step-Code#144 · 1 commento ·
Tutte le issue di stepfun-ai/Step-Code
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
mksglu/context-mode#1200 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
anthropics/claude-code#96687 ·
-
good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
AOSSIE-Org/DebateAI#582 · 2 commenti ·