Skip to content

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

Closed as not planned

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

Activity

  1. github-actions commented on Jun 3, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If your issue is distinct from those, please add a comment explaining how it differs.

  2. chirag127 commented on Jul 1, 2026

    @chirag127

    @-

  3. github-actions commented on Aug 31, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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