Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#136 4 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
65/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
git, shell, typescript

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
TypeScript
Star
54
Fork
20
Merge trung bình
4 giờ 1 phút
Pull request đã merge (30 ngày)
12

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của stepfun-ai/Step-Code

Tất cả issue của stepfun-ai/Step-Code

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.