anomalyco / anomalyco/opencode

[v2] Image path is replaced with its display label when executing shell commands

Open
#38,634 0 comments 0 reactions 1 assignee View on GitHub

@kommander is already working on this.

Since Jul 24, 2026.

2.0
Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

When I type or paste the path to an image file into the shell input box, OpenCode compacts the path into an [Image 1] label. However, when the command is executed, the display label appears to be passed directly to the shell instead of the original file path.

For example, the intended command:

open '/path/to/image.png'

is effectively executed as:

open [Image 1]

This causes zsh to interpret [ as the beginning of a glob pattern and return:

zsh:1: bad pattern: [Image

The compact image token should retain the original path internally, and the shell command should be serialized using the properly escaped original path rather than the visible [Image 1] label.

Image Image
Plugins

NULL

OpenCode version

opencode2 v0.0.0-next-16116

Steps to reproduce
  1. Type a legal path to a image file in shell input box (zsh)
  2. Press Enter
Operating System

macOS 26.6 Public Beta

Terminal

Ghostty Build 16663

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.