Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#136 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
65/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
git, shell, typescript

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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 的许可。

Lenguaje dominante
TypeScript
Estrellas
54
Forks
20
Merge medio
23 min
PR fusionados (30 d)
7

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de stepfun-ai/Step-Code

Todos los issues de stepfun-ai/Step-Code

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.