Skip to content

fix(spawn): pin Git Bash for Windows Terminal - #40

Merged
orangewk merged 1 commit into
mainfrom
codex/issue39-windows-git-bash
Aug 4, 2026
Merged

fix(spawn): pin Git Bash for Windows Terminal#40
orangewk merged 1 commit into
mainfrom
codex/issue39-windows-git-bash

Conversation

@orangewk

@orangewk orangewk commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • resolve the Bash executable from the running Git Bash environment before launching Windows Terminal
  • convert the MSYS/Cygwin path to a native Windows path with cygpath -w
  • pass that explicit executable to both wt.exe and wt, avoiding Windows PATH resolution of bare bash
  • add a regression test that simulates Git Bash and WSL Bash coexistence

Root cause

The Windows launcher used wt.exe new-tab bash -l .... Because wt.exe is native, bare bash is resolved through the Windows PATH and can select the WSL bash.exe shim. WSL Bash then cannot open the Git Bash/Windows-style boot-script path.

Impact

Windows users with Git Bash and WSL installed can use the default spawn.sh Windows Terminal path without a custom --terminal workaround. Custom terminal templates are unchanged.

Validation

  • bats tests/test_spawn.bats --filter 'Windows Terminal receives' — pass
  • bash -n scripts/spawn.sh — pass
  • git diff --check — pass
  • bats tests/test_spawn.bats — 73 pass, 2 pre-existing Windows-local failures
    • spawn: errors when $TMUX is set but tmux is not on PATH
    • spawn: refuses when the name is held by another live session
  • both failures reproduce unchanged at the v1.1.13 merge commit (4bcfde9)
  • local ShellCheck executable was unavailable; CI remains the static-analysis gate

Closes #39

@orangewk
orangewk marked this pull request as ready for review August 4, 2026 10:55
@orangewk
orangewk merged commit 23e5386 into main Aug 4, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows spawn uses WSL bash instead of Git Bash

1 participant