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
TUI: pasted image paths force attachments in V2 #57298
Pasting a local image path into the TUI automatically converts it into an image attachment. Sometimes I only want to include the path as plain text.
#19892 describes the same bug. It was closed during the V1-to-V2 migration, not because a fix shipped. The bug still exists in V2.
Expected Behavior
There should be a way to keep the pasted path as plain text.
Ideally, clicking the attachment placeholder should expand it into the original path and remove the image attachment.
Actual Behavior
The path becomes an image attachment such as [Image 1]. Unlike collapsed pasted text, it cannot be expanded into editable path text.
Thanks for the report, and for linking the earlier v1 issue.
To restate the request: when you paste a local image path into the TUI prompt, you'd like to be able to keep it as plain text instead of having it turned into an [Image N] attachment. Ideally you could expand the image chip back into the original path, the way collapsed text pastes can be expanded.
I checked the current code: turning pasted paths that point to local images or PDFs into attachments is deliberate, and only text pastes can be expanded today. So I've filed this as a feature request rather than a bug. Maintainers will consider it.
This can't be done as a plugin right now, because plugins have no way to hook into pasting in the TUI.
Same experience here: I copy a path as text, paste it, and it silently becomes an image chip. Often the whole point of pasting a path is to hand the agent a path, not a bitmap.
I checked the shipped 2.1.2 binary to make sure there is no existing switch: the paste handler trims the pasted text, strips surrounding single/double quotes, then converts it whenever it resolves to an existing local file whose extension maps to avif/gif/jpeg/jpg/png/svg/webp/pdf (≤20 MB). There is no config read and no modifier check on that path. prompt.paste only chooses compact vs full text, and the prompt block in cli.json only exposes editor, paste, image_preview. Plugins also can't intercept paste, as the bot already noted.
Concrete proposal — one setting, default keeps today's behavior:
text: never convert pasted paths; always insert the literal path.
ask: insert the path, then offer a one-key choice to attach instead.
A modifier or "undo immediately after paste restores the original path" would help too, but an explicit setting is what makes it predictable. The same gate would also cover the text-only-model and context-overflow variants in #57698 and #57162.
Activity
opencode-agent commentedon Oct 20, 2026
Thanks for the report, and for linking the earlier v1 issue.
To restate the request: when you paste a local image path into the TUI prompt, you'd like to be able to keep it as plain text instead of having it turned into an
[Image N]attachment. Ideally you could expand the image chip back into the original path, the way collapsed text pastes can be expanded.I checked the current code: turning pasted paths that point to local images or PDFs into attachments is deliberate, and only text pastes can be expanded today. So I've filed this as a feature request rather than a bug. Maintainers will consider it.
This can't be done as a plugin right now, because plugins have no way to hook into pasting in the TUI.
Related issues:
maharshi365 commentedon Oct 20, 2026
This isnt a feature request. I literally cant paste in file paths to images. It always attaches and thats not a behavior i want. @opencode-agent
laidz commentedon Oct 22, 2026
+1 on v2.1.2 (macOS 27, Apple Terminal, zsh).
Same experience here: I copy a path as text, paste it, and it silently becomes an image chip. Often the whole point of pasting a path is to hand the agent a path, not a bitmap.
I checked the shipped 2.1.2 binary to make sure there is no existing switch: the paste handler trims the pasted text, strips surrounding single/double quotes, then converts it whenever it resolves to an existing local file whose extension maps to
avif/gif/jpeg/jpg/png/svg/webp/pdf(≤20 MB). There is no config read and no modifier check on that path.prompt.pasteonly chooses compact vs full text, and thepromptblock incli.jsononly exposeseditor,paste,image_preview. Plugins also can't intercept paste, as the bot already noted.Concrete proposal — one setting, default keeps today's behavior:
{ "prompt": { "paste_paths": "attach" // "attach" | "text" | "ask" } }attach(default): current behavior.text: never convert pasted paths; always insert the literal path.ask: insert the path, then offer a one-key choice to attach instead.A modifier or "undo immediately after paste restores the original path" would help too, but an explicit setting is what makes it predictable. The same gate would also cover the text-only-model and context-overflow variants in #57698 and #57162.
Related: #57162, #57698, #48190.
Environment