You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dug into the source to see what's actually happening here.
Root cause: on Windows the bash tool always shells out to bare cmd.exe /d /s /c "<command>" (internal/tools/bash.go) — there's no Git-Bash, WSL, or PowerShell path. Since commands are generated in POSIX-flavored syntax (&& chains, export, $(...), ~, piped utilities like grep/sed/head/awk), cmd.exe either can't parse them or silently mishandles them.
Detection of these mismatches is also thin:
Pre-execution (detectShellCommandIssue in internal/tools/shell_runtime.go) only flags cd /... and ls patterns — nothing for export, $(...), quoting, or piped POSIX tools.
Post-execution (detectShellOutputIssue) only matches two exact English cmd.exe error strings, so it misses non-English locales and any silent misparse that doesn't error at all.
There's also a separate, documented limitation: under the sandbox's restricted token, Schannel-backed TLS (e.g. curl.exe over HTTPS) fails with SEC_E_NO_CREDENTIALS (internal/sandbox/windows_command_runner_windows.go) — noted in-code as a known gap with no fix, just workarounds (degraded path or the web_fetch tool).
The recent fix/windows-interactive-command-suggestions work (c82d4e3, 9723150) only reworded the block-message suggestions for interactive commands (e.g. suggesting type/tasklist instead of cat/ps aux) — it doesn't touch the underlying shell mismatch, so this issue is still open.
Possible directions, roughly in order of effort:
Broaden the pre/post-execution mismatch detection to catch more POSIX-isms and give better translation hints (low risk, doesn't change what shell runs).
Add an opt-in PowerShell execution path (powershell.exe -NoProfile -Command) alongside cmd.exe — PowerShell has aliases (ls, cat, pwd) and richer piping, closer to POSIX semantics without a new dependency.
Auto-detect and prefer Git-Bash (bash.exe) when present on PATH for genuinely bash-compatible semantics — bigger change touching the sandbox wrapping (BuildWindowsSandboxCommandArgs, COMSPEC env default).
Happy to pick one of these up if there's a preference.
Activity
PierrunoYT commentedon Jul 3, 2026
Dug into the source to see what's actually happening here.
Root cause: on Windows the
bashtool always shells out to barecmd.exe /d /s /c "<command>"(internal/tools/bash.go) — there's no Git-Bash, WSL, or PowerShell path. Since commands are generated in POSIX-flavored syntax (&&chains,export,$(...),~, piped utilities likegrep/sed/head/awk),cmd.exeeither can't parse them or silently mishandles them.Detection of these mismatches is also thin:
detectShellCommandIssueininternal/tools/shell_runtime.go) only flagscd /...andlspatterns — nothing forexport,$(...), quoting, or piped POSIX tools.detectShellOutputIssue) only matches two exact Englishcmd.exeerror strings, so it misses non-English locales and any silent misparse that doesn't error at all.There's also a separate, documented limitation: under the sandbox's restricted token, Schannel-backed TLS (e.g.
curl.exeover HTTPS) fails withSEC_E_NO_CREDENTIALS(internal/sandbox/windows_command_runner_windows.go) — noted in-code as a known gap with no fix, just workarounds (degraded path or theweb_fetchtool).The recent
fix/windows-interactive-command-suggestionswork (c82d4e3, 9723150) only reworded the block-message suggestions for interactive commands (e.g. suggestingtype/tasklistinstead ofcat/ps aux) — it doesn't touch the underlying shell mismatch, so this issue is still open.Possible directions, roughly in order of effort:
powershell.exe -NoProfile -Command) alongsidecmd.exe— PowerShell has aliases (ls,cat,pwd) and richer piping, closer to POSIX semantics without a new dependency.bash.exe) when present on PATH for genuinely bash-compatible semantics — bigger change touching the sandbox wrapping (BuildWindowsSandboxCommandArgs,COMSPECenv default).Happy to pick one of these up if there's a preference.