3
43
Fork
You've already forked opencode.el
16

Support Pasting an image #32

Closed
opened 2026年04月29日 09:18:13 +02:00 by dfrkp · 3 comments

Using opencode.el 808c168e33 on GNU Emacs 30.2 (build 1, aarch64-apple-darwin23.2.0, NS appkit-2487.30 Version 14.2 (Build 23C64)) of 2025年12月06日 I'm unable to past an image to the chat because C-v is being shadowed.
Would it be possible to add a command to get a image from the clipboard to the opencode session?

Using opencode.el 808c168e33d24601d3513e4b845573d39ffa1fa0 on GNU Emacs 30.2 (build 1, aarch64-apple-darwin23.2.0, NS appkit-2487.30 Version 14.2 (Build 23C64)) of 2025年12月06日 I'm unable to past an image to the chat because C-v is being shadowed. Would it be possible to add a command to get a image from the clipboard to the opencode session?
Owner
Copy link

Right now you can add image files with with C-c f (opencode-add-file) or opencode-add-file-dwim (in a buffer with the image file open, or in dired with the point over the image file name). We don't support pasting images from clipboard yet, I think the emacsy way to do it would be to register a yank-media-handler for opencode-session-mode so that yank-media works.

Right now you can add image files with with `C-c f (opencode-add-file)` or `opencode-add-file-dwim` (in a buffer with the image file open, or in dired with the point over the image file name). We don't support pasting images from clipboard yet, I think the emacsy way to do it would be to register a `yank-media-handler` for `opencode-session-mode` so that `yank-media` works.
Author
Copy link

Thanks for looking into this so quickly! I had found the add-file approach, but found it wasn't too handy as one needs to store the image somewhere first (rather than taking a screenshot and pasting it directly). yank-media sounds like a good approach and possible future improvement. Understanding that approach I though also think the C-c f (opencode-add-file) approach is a totally reasonable workaroung. Feel free to close the ticket or keep it open for future reference.
Thank you overall for putting this package together! It's overall a joy to use!

Thanks for looking into this so quickly! I had found the add-file approach, but found it wasn't too handy as one needs to store the image somewhere first (rather than taking a screenshot and pasting it directly). `yank-media` sounds like a good approach and possible future improvement. Understanding that approach I though also think the `C-c f (opencode-add-file)` approach is a totally reasonable workaroung. Feel free to close the ticket or keep it open for future reference. Thank you overall for putting this package together! It's overall a joy to use!
Owner
Copy link

opencode+GPT made short work of it, yank-media should work now in opencode session buffers

opencode+GPT made short work of it, `yank-media` should work now in opencode session buffers
Sign in to join this conversation.
No Branch/Tag specified
main
No results found.
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sczi/opencode.el#32
Reference in a new issue
sczi/opencode.el
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?