anomalyco / anomalyco/opencode
[v2] Image path is replaced with its display label when executing shell commands
@kommander is already working on this.
Since Jul 24, 2026.
- 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.
Plugins
NULL
OpenCode version
opencode2 v0.0.0-next-16116
Steps to reproduce
- Type a legal path to a image file in shell input box (zsh)
- Press
Enter
Operating System
macOS 26.6 Public Beta
Terminal
Ghostty Build 16663
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.