Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Windows 自定义 Git 安装目录下误选 WSL Bash(fork 已修复,申请贡献上游)

Aperta
#136 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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

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

untriaged
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(复现步骤)
  1. 将 Git for Windows 安装在自定义目录,把其 cmd 目录加入 PATH。
  2. PATH 同时包含带 WSL bash.exe 的 Windows System32;不配置 shellPath。
  3. 调用源码中的 getShellConfig(),结果选中 WSL 启动器,而不是该 Git 安装内的 Bash。

复现直接调用核心解析函数,不加载扩展;尚未执行模板要求的交互式 pi -ne 检查。

Expected behavior(预期行为)

自动发现原生 Git Bash,避免静默切换到 WSL;保留通过 shellPath 显式选择 WSL 的能力。

Version(版本)

复现源码基线:cb5fc1456d49d49c62e072bfed2926220083214e。

已完成修复与验证

修复已合并到个人 fork:PR #1PR #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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di stepfun-ai/Step-Code

Tutte le issue di stepfun-ai/Step-Code

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.