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
{{ message }}
Repository navigation
Shell notes for PowerShell 5.1 recommend backtick escaping, which corrupts commands #42402
On Windows PowerShell 5.1, double quotes passed to an external program are silently
stripped and the argument can split. Nothing errors and the exit code is 0, so commands
corrupt instead of failing. The shell notes make it worse by telling the agent to escape
with the backtick, which for this case splits the argument even further.
Plugins
N/A
OpenCode version
1.18.18 (Desktop)
Steps to reproduce
node -e "console.log(JSON.stringify(process.argv.slice(1)))" 'a "b c" d'
expected ["a \"b c\" d"]
actual ["a b","c d"]
Real case: ssh host 'sed -i "s/\r$//" file' arrived unquoted and deleted every trailing
letter r instead of carriage returns. It reported success, so I only noticed hours later.
The 5.1 notes say "Escape special characters with the PowerShell backtick character".
For this failure that makes it worse:
Fixed upstream in PowerShell 7.3 via $PSNativeCommandArgumentPassing = 'Standard', which
doesn't exist in 5.1. Shell.win() already prefers pwsh, so this only hits users without
PowerShell 7+. Encoding the command doesn't help; the corruption is on the PowerShell to
child process hop.
Screenshot and/or share link
N/A, no UI changes.
Operating System
Windows 10 Home 22H2 (build 19045)
Terminal
OpenCode Desktop app, shell is Windows PowerShell 5.1.19041.7663 (pwsh not installed)
This issue might be a duplicate of existing issues. Please check:
PowerShell: backslash escapes in command args are mangled and land literally in output #39884: PowerShell backslash escapes in command args are mangled — covers the same root cause (PowerShell 5.1 escape character confusion corrupting command arguments), though that issue focuses on backslash vs backtick while this one specifically calls out that the shell notes actively recommend the wrong escaping approach
Activity
github-actions commentedon Aug 13, 2026
This issue might be a duplicate of existing issues. Please check:
thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊