Skip to content

"shell": "pwsh" config not respected, still uses PowerShell 5.1 on Windows #30615

Description

@seka-qiguan

Description

Bug Description
The shell setting in opencode.json is set to "pwsh" but opencode still uses PowerShell 5.1 (powershell.exe) as the default shell.

Config
~/.config/opencode/opencode.json:

{
"$schema": "https://opencode.ai/config.json",
"shell": "pwsh",
"provider": {}
}
Actual Behavior
Running commands through the bash tool executes in PowerShell 5.1:

PSVersion: 5.1.26100.8457
ProcessName: powershell
Path: C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.EXE
Expected Behavior
When "shell": "pwsh" is configured, commands should execute in PowerShell 7 (pwsh.exe), which defaults to UTF-8 and resolves Chinese encoding issues that plague PS 5.1.

Environment
OS: Windows (win32)
PowerShell 5.1: C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.EXE
PowerShell 7: installed and available at pwsh
opencode config: ~/.config/opencode/opencode.json with "shell": "pwsh"
Impact
Chinese (and other non-ASCII) characters are garbled in PS 5.1 due to GB2312 default encoding. PS 7 uses UTF-8 by default and works correctly.

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions