GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — {env:VAR} in permission keys expands to native Windows backslashes, producing invalid JSON on Windows · Issue #32695 · anomalyco/opencode

{env:VAR} in permission keys expands to native Windows backslashes, producing invalid JSON on Windows #32695

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
{env:VAR} in permission keys expands to native Windows backslashes, producing invalid JSON on Windows#32695
Copy link
Assignees
Hona

Description

@ple-4js
ple-4js
opened on Jun 17, 2026
Issue body actions

Description

When an environment variable is set with a native Windows path (backslashes), using{env:VAR}as a permission key causes opencode to fail with a JSON parse error on startup.

Plugins

No response

OpenCode version

1.14.33

Steps to reproduce

  1. Set an environment variable with a native Windows path:

    set MYDIR=C:\Users\me\AppData\Roaming\MyApp\config

  2. Add it as a permission key in opencode.json:

    "permission": {
    "external_directory": {
    "{env:MYDIR}/**": "allow"
    }
    }

  3. Run opencode .

Expected behavior

opencode normalizes the expanded path to forward slashes before using it as a JSON key, or accepts backslashes in permission key paths on Windows.

Actual behavior

opencode expands {env:MYDIR} literally and treats the backslashes as JSON escape sequences, producing a parse error:

--- Errors ---
InvalidEscapeCharacter at line N, column 7
   Line N:       "C:\Users\me\AppData\Roaming\MyApp\config/**": "allow"
                ^
--- End ---

Workaround

Set the environment variable with forward slashes before launching opencode:

set MYDIR=C:/Users/me/AppData/Roaming/MyApp/config

This is not always possible when the variable is set by a third-party application that uses native Windows path separators.

Suggested fix

Normalize {env:...} expanded values to forward slashes before inserting them as permission key paths.

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

No response

Activity

  1. github-actions
    assigned
    Hona
    on Jun 17, 2026
  2. github-actions commented on Aug 17, 2026

    @github-actions
    github-actionsBot
    on Aug 17, 2026 – with GitHub Actions
    Contributor
    More actions

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

  3. github-actions
    closed this as not plannedon Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @Hona
    Hona

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

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.