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
In opencode when you paste an image it takes around 200ms to read the image and show the image marker in opencode. The time is very noticeable and does not feel like a good experience. This is happening because we are using osascript on mac and powershell on windows which eventually creates a new shell and process and uses the commands to copy image to file then read it. The part where it uses external shell adds about 150ms to the time which is unnecessary because it could be a pre built binary or library which does not have to create shell each time to paste image and will be near instant (like 5ms). Check the video below:
Plugins
none
OpenCode version
1.18.4
Steps to reproduce
Copy an image in your clipboard
Paste in opencode
Observe a 200ms time difference in pasting and image marker showing.
Screenshot and/or share link
I enabled keystroke highlightin in bottom left corner see the button press there and the delay in image marker display
AppleScript coercion: the clipboard as "PNGf" costs about 200ms per megabyte, so a 12MB screenshot takes 2.5s. Spawning osascript is only 40ms of it on my laptop.
#46456 reads the pasteboard through the ObjC bridge instead. 2500ms → 167ms at 12MB (no new dependency & behavior unchanged).
@kommander hi, can you assign this to me and add the bug / perf label?
Activity
affanali2k3 commentedon Aug 9, 2026
bump
fix(tui): speed up clipboard image paste
shivankj11 commentedon Aug 31, 2026
AppleScript coercion:
the clipboard as "PNGf"costs about 200ms per megabyte, so a 12MB screenshot takes 2.5s. Spawningosascriptis only 40ms of it on my laptop.#46456 reads the pasteboard through the ObjC bridge instead. 2500ms → 167ms at 12MB (no new dependency & behavior unchanged).
@kommander hi, can you assign this to me and add the bug / perf label?
affanali2k3 commentedon Sep 2, 2026
This is a great approach too. The main delay is due to OSAscript
thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊