Windows desktop app ignores defaultShell: "bash" for ! commands, always uses PowerShell
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
In the desktop app's Code tab on Windows, commands entered with the ! prefix always run in Windows PowerShell 5.1, even with "defaultShell": "bash" in ~/.claude/settings.json and Git for Windows installed.
The settings reference says defaultShell picks whether Bash or PowerShell runs ! commands. The CLI honors it. The desktop app does not.
I have a bash function that I wrote in .bashrc called "wta". Running !type wta in the Code tab gives:
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
PS C:\Users\<user>\source\repos\VV> type wta
type : Cannot find path 'C:\Users\<user>\source\repos\VV\wta' because it does not exist.
The banner only shows on the first ! command, so the app keeps one PowerShell process around for these. It is separate from the Terminal pane, which does not show the commands.
I checked every settings layer for something overriding it and found nothing:
- Managed settings: hooks only, no
defaultShell - User settings:
"defaultShell": "bash" - Project and local settings: nothing shell related
CLAUDE_CODE_USE_POWERSHELL_TOOLandCLAUDE_CODE_GIT_BASH_PATHnot set- Git Bash is at
C:\Program Files\Git\bin\bash.exeand on PATH
The only place PowerShell is chosen is the desktop app's own config, %APPDATA%\Claude\config.json, which has terminalCliPowerShellPath pointing at PowerShell 5.1 and no bash or shell-choice key. The desktop settings UI has no shell option either.
Claude's own Bash tool works fine in the same session, so this is specific to how the desktop app runs ! commands
<img width="1202" height="1168" alt="Image" src="https://github.com/user-attachments/assets/31f808c8-1c0b-40f0-92c3-6017b4d61394" />
What Should Happen?
! commands in the desktop app should run in Git Bash when defaultShell is "bash", the same as the CLI does.
If the desktop app is meant to be PowerShell-only on Windows, the docs for defaultShell should say so.
Error Messages/Logs
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows
PS C:\Users\<user>\source\repos\VV> type wta
type : Cannot find path 'C:\Users\<user>\source\repos\VV\wta' because it does not exist.
At line:1 char:1
+ type wta
+ ~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\Users\<user>\source\repos\VV\wta:String) [Get-Content], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand
~/.claude/settings.json:
{
"model": "opus[1m]",
"autoUpdatesChannel": "latest",
"tui": "fullscreen",
"skipWorkflowUsageWarning": true,
"verbose": true,
"autoCompactEnabled": true,
"skipAutoPermissionPrompt": true,
"autoMemoryEnabled": false,
"defaultShell": "bash"
}
Session environment:
CLAUDE_CODE_ENTRYPOINT=claude-desktop
CLAUDE_CODE_DESKTOP_APP_VERSION=1.52386.0
CLAUDE_AGENT_SDK_VERSION=0.3.266
SHELL=/bin/bash.exe
Steps to Reproduce
- Windows 11 with Git for Windows installed at the default location.
- Set
"defaultShell": "bash"in~/.claude/settings.json. Make sure no other settings layer sets it. - Open a project in the desktop app's Code tab.
- Type
!ls -lain the chat and press Enter. - The output starts with the Windows PowerShell banner and the command runs in PowerShell.
- Run
claudefrom a Git Bash terminal in the same project and type!ls -la. It runs in bash as expected.
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.266 (bundled with Claude desktop app 1.52386.0)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
This was reported before in #72389, #61516, and #69375. All three were closed by the stale bot without a fix. The bot on #72389 said to open a new issue if it still happens, so here it is. Still reproduces on desktop 1.52386.0 with Claude Code 2.1.266.
#78596 looks like the same hardcoded powershell.exe path. #82486, #83889, and #70276 are open feature requests for a shell picker. This report is about the existing defaultShell setting being ignored, not a new setting.
Docs: https://code.claude.com/docs/en/settings-reference (defaultShell) and https://code.claude.com/docs/en/interactive-mode
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗