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
{env:VAR} substitutions break on Windows (backslashes in paths produce InvalidEscapeCharacter) #20640
{env:VAR} substitutions are broken on Windows. Paths in opencode.jsonc using {env:XDG_CONFIG_HOME} or {env:HOME} trigger InvalidEscapeCharacter errors and prevent the config from loading.
The issue is in packages/opencode/src/config/paths.ts. The substitute function performs a raw string replacement before the JSONC parser runs:
On Windows, HOME contains backslashes (e.g., C:\Users\name). After substitution, the JSON contains sequences like \U, which are invalid escape characters, causing the parser to crash.
The Fix:
Swap backslashes for forward slashes after expanding the variable:
Activity
mynameistito commentedon Apr 2, 2026
sorry for the ping kmdr, but it my agent cooked the wrong commit there, but it seems like it has been an issue since yesterday*
mynameistito commentedon Apr 2, 2026
Closing - incorrect root cause attribution. Filing a corrected issue.
Social-Mean commentedon Apr 2, 2026
Hi @mynameistito , I encountered the same problem on Windows. How did you solve it?
mynameistito commentedon Apr 2, 2026
I didn't, I just reaped remapped it without the var @Social-Mean. Will kick off an agent later to try find an accurate location of it.