Skip to content

Specific bash commands fail on Windows in Git Bash due to path re-mapping #4379

Closed

Description

@keathmilligan

Description

When running opencode from a git bash shell session on Windows, cd, rm, cp, mv, mkdir, touch, chmod and chown always result in:

This command references paths outside of ${Instance.directory} so it is not allowed to be executed.

This is due to how git bash remaps Windows-style paths to Unix style paths. See https://github.com/sst/opencode/blob/1e6589526d36b814e8af30a81932d0e9967c64ac/packages/opencode/src/tool/bash.ts#L92. The resolved path will be something like /c/Users/bob/workspace but the instance path will be a Windows-style path like C:\Users\bob\workspace causing the check to fail and the command to be rejected.

OpenCode version

1.0.65

Steps to reproduce

Issue a prompt like "Run cd src && ls and show me the output".

Screenshot and/or share link

Image

Operating System

Windows 11

Terminal

Windows Terminal

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 16, 2025
  2. self-assigned this
    on Nov 16, 2025
  3. removed
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions