Problem
When running OpenCode in WSL via Windows Terminal, pasting images from the clipboard with Ctrl+V doesn't work due to three compounding issues:
- Windows Terminal intercepts Ctrl+V at the emulator level before it reaches the app's stdin. When the clipboard contains only an image (no text), WT has nothing to paste and sends zero bytes — no event fires at all.
- WSLg clipboard bridge returns BMP format (not PNG/JPEG), which the LLM API rejects with:
media_type: Input should be 'image/jpeg', 'image/png', 'image/gif' or 'image/webp'
wl-paste needs XDG_RUNTIME_DIR=/mnt/wslg/runtime-dir on WSLg to access the Wayland clipboard socket, not the default /run/user/0/.
Steps to Reproduce
- Run OpenCode in WSL2 via Windows Terminal
- Copy an image to the Windows clipboard (e.g., Win+Shift+S screenshot)
- Press Ctrl+V in the OpenCode prompt
- Nothing happens
Expected Behavior
The image should be pasted into the prompt as an attachment.
Environment
- WSL2 on Windows with WSLg
- Windows Terminal (does not implement Kitty keyboard protocol)
wl-clipboard package installed (wl-paste available)
Problem
When running OpenCode in WSL via Windows Terminal, pasting images from the clipboard with Ctrl+V doesn't work due to three compounding issues:
media_type: Input should be 'image/jpeg', 'image/png', 'image/gif' or 'image/webp'wl-pasteneedsXDG_RUNTIME_DIR=/mnt/wslg/runtime-diron WSLg to access the Wayland clipboard socket, not the default/run/user/0/.Steps to Reproduce
Expected Behavior
The image should be pasted into the prompt as an attachment.
Environment
wl-clipboardpackage installed (wl-pasteavailable)