Conversation
… Code Replace the Windows shell chain pwsh -> powershell -> cmd with Git Bash (POSIX semantics) first, keeping pwsh/powershell/cmd as fallbacks only when Git Bash is missing. - find_git_bash resolves via LIVEAGENT_GIT_BASH_PATH, then CLAUDE_CODE_GIT_BASH_PATH, then bash.exe on PATH (skipping the WSL launcher in System32), then default Git for Windows install paths - Git Bash candidate runs bash -c without encoding prefixes; the PowerShell/cmd fallbacks keep their UTF-8 setup verbatim - ManagedProcess inherits the new chain via spawn_platform_shell_command - Tool description, system prompt, and failure hints flip to POSIX-first guidance; a degraded run (shell_family powershell/cmd) now hints to install Git for Windows or set LIVEAGENT_GIT_BASH_PATH - POSIX ampersand background validation now applies on Windows too - Tests: chain-order and env-override cfg(windows) tests, flipped Windows cases in shell-tools/markdown-image-policy suites
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Aligns the built-in Bash tool's Windows shell selection with Claude Code: Git Bash (POSIX semantics) first, with pwsh → Windows PowerShell → cmd kept only as fallbacks when Git Bash is not installed.
Shell resolution (matches Claude Code)
find_git_bash()inshell_runner.rsresolves Git Bash in priority order:LIVEAGENT_GIT_BASH_PATHenv var, thenCLAUDE_CODE_GIT_BASH_PATH(trim → unquote → tilde-expand →is_file)bash.exeonPATH, skipping%SystemRoot%\System32(that's the WSL launcher, not Git Bash)ProgramFiles/ProgramW6432/ProgramFiles(x86)+ hardcoded roots), preferringGit\bin\bash.exeoverGit\usr\bin\bash.exeThe Git Bash candidate runs
bash -c(non-login;-lcwould source/etc/profileand cd to$HOME, breaking cwd) with no encoding prefix. The PowerShell/cmd fallbacks keep their UTF-8 setup verbatim. ManagedProcess inherits the new chain automatically viaspawn_platform_shell_command.Model guidance flipped to POSIX-first
buildToolsSuffix), and failure hints now instruct POSIX/bash syntax on Windowsshell_family: powershell/cmd) hints to install Git for Windows or setLIVEAGENT_GIT_BASH_PATH&background-detach validation now applies on Windows too (Bash + ManagedProcess); the oldruntimePlatform !== "windows"gates are removedwindows-git-bash/posixUntouched
Interactive terminal (
terminal/shell.rs), MCP launchercmd.exe, web frontend (no shellTools mirror).Testing
pnpm test(agent-gui): 1103 pass / 0 failcargo test shell_runner: 10 passcargo fmt --check/ Biome clean#[cfg(windows)]tests (chain order, env-override precedence) need Windows CI/machine to actually run; the cfg(windows) code was compile-verified separately (cross-targetcargo checkon macOS dies inaws-lc-sys's C build script, unrelated to this change)