[Bug] The system prompt says the default shell is bash on Windows, but execute_bash always runs cmd.exe
Description
The prompt's "Default Shell" line uses process.env.SHELL first. When Nanocoder is started from Git Bash, SHELL is set, so the model is told the shell is bash. execute_bash on Windows always runs %ComSpec% (cmd.exe), so bash syntax like "$HOME" is not expanded.
Environment
- OS: Windows 11 Home 10.0.26300 (started from Git Bash)
- Node version: v22.22.3
- Nanocoder version: 1.32.0 (built from main at eb7dee57)
- Provider: Not provider-specific
- Model: Not model-specific
Steps to Reproduce
- On Windows set
SHELL=C:\Program Files\Git\usr\bin\bash.exe. - Call
buildSystemPrompt('normal', undefined, ['execute_bash'])and read the "Default Shell" line. - Run
bashExecutor.execute('echo "home=$HOME"').
Expected Behavior
The prompt names the shell the tool really uses (%ComSpec% / cmd.exe) on Windows.
Actual Behavior
Default Shell: C:\Program Files\Git\usr\bin\bash.exe
The command prints "home=$HOME" literally (cmd.exe does not expand it).
Additional Context
- [x] I have searched existing issues to ensure this is not a duplicate
- [x] I can reproduce this issue consistently
- [x] This issue occurs with the latest version of nanocoder (main)
Suggested fix:
source/conversation/prompt-builder.ts:80(getDefaultShell): onwin32returnprocess.env.COMSPEC || 'cmd.exe'first, because that is whatsource/services/bash-executor.tsspawns.- Add a Windows test with
SHELLset to a bash path.
Related: #1280 (configurable shell for execute_bash), PR #1667 (cmd.exe verbatim arguments).
I'd like to pick this up. I'm on Windows with Git Bash, so I can reproduce it directly. Plan: in getDefaultShell (prompt-builder.ts), check win32 first and return COMSPEC || 'cmd.exe', which is what bash-executor.ts spawns. I'll add a test that sets SHELL to a bash path on win32 and checks that the prompt names cmd.exe, while the non-Windows behaviour stays the same.
sure @Kidkender, just assigned you