Image pasting in Windows to WSL in Terminal directly from clipboard
What feature would you like to see?
People already reported this:
- https://github.com/openai/codex/issues/2221
- https://github.com/openai/codex/issues/2292
But it seems not all options are covered:
- Basically an image can be dragged and dropped to Windows Terminal with WSL session and it correctly works.
- If i copy file in Windows Explorer and paste it into Windows Terminal with WSL all i get is path, maybe this would be useful, but the path is from windows and Codex usually doesn't like those paths as it claims it's can't get out of sandbox or claims it's not available
- But I often do screenshots with ShareX and it has a copy feature, when doing CTRL+V it does nothing.
- Copying "virtual image" from photos doesn't work either.
Supposedly should be implemented in: https://github.com/openai/codex/commit/468a8b4c38bc9b8651db9607f122c2eb50ff4730
This means the correct implementation (full one):
- Dragging file to WSL Terminal should work and produce an image for Codex
- Copying a file frrom Windows Explorer and pasting into terminal should produce an image for Codex
- Copying an image from apps like sharex, etc that have the image in memory and put it in clipboard and pasting it.. should produce an image for Codex
Are you interested in implementing this feature?
Probably not. Maybe if it gets denied, and i can use codex to fix codex :-)
Additional information
No response
I also have the same problems.
i had the same problem
Can confirm, same issue. Super annoying to always have to save screenshots and then manually tell codex about them.
I can confirm here. just did the suggested update yesterday
now it says
_ OpenAI Codex (v0.46.0)
if you hit ? it now shows
/ for commands ctrl + j for newline
@ for file paths ctrl + v to paste images
esc esc to edit previous message ctrl + c to exit
ctrl + t to view transcript
ctrl + v to paste images
but when I do have an image in the clipboard, nothing gets pasted at all. whereas the text paste works great + image paste in chatgpt works great too.
typical scenario: I screenshot something that gets added to the clipbaord, and I hit CTRL+V pretty much anywhere, and i'd like to do it in codex cli whereas it says it can accept it with a CTRL+V => quite frustrating
context: windows 11, codex cli running in wsl as suggested in the official openai install documentation a couple weeks ago when I first installed it
ctrl + v to paste images not work on WSL on 0.46
Can confirm. Image pasting not working
0.47 still not working
Pull request: https://github.com/openai/codex/pull/5644
just upgraded to codex-cli 0.53.0 still not working
just upgraded to codex-cli 0.53.0 still not working
A temporary work around: https://github.com/unclejimao/WSL-Image-Clipboard-Helper/tree/performance-optimize
Same Problemo
This is the best candidate to get this fixed but the author is still waiting on things
https://github.com/openai/codex/pull/5644
Done in 0.66-alpha 2
@Waxime64 Am I misunderstanding something?
- STRG + V: Nothing happens. As far as I know, there is no other way.
- STRG + ALT + V:
■ Failed to paste image: no image on clipboard: The clipboard contents were not available in the requested format or the clipboard is empty.
Codex CLI 0.66.0 / WSL2 / Ubuntu 24.04 (Host system: Windows 11 Pro & screnshot with Windows Snipping Tool)
What works for me now :
- Copy paste from Windows Explorer to WSL Codex (but also to windows codex)
- Drag and drop from Windows Explorer to WSL Codex (but also to windows codex)
- Copy from Photos app to WSL Codex (and windows codex) via memory
All done with CTRL+V.
However what didn't work is ShareX copy to clipboard and paste. That still doesn't work. Not sure how it's different. Maybe that is your case?
Actually CLTR+ALT+V copies the image from memory of ShareX and pastes it into Codex WSL, also works on Windows Codex.
Weird a bit that 2 different options to paste.
@PrzemyslawKlys So when I take a screenshot with the Snipping Tool (default tool for windows) and insert it into Word, I can see the photo. The same applies to web uploads, where you can insert an image using CTRL + V. Why use CTRL + ALT + V in the console: https://github.com/openai/codex/pull/6793#:~:text=Why%20Ctrl%2BV%20doesn%27t%20work%20in%20WSL%20terminals
Moving the file from Explorer to WSL Chat has always worked for me so far. But the advantage would be that you wouldn't always have to save first. But for some reason, Codex still can't process the screenshot.
Well i just tested
Works both for WSL window and powershell (windows) window. I use Windows Terminal tho, so WSL runs within it. So it works for me in all cases including from nipping tool copy.
Thanks for the link to 6793, however it works 90% of the time for me with CTRL+V, just not for the memory one.
Actually CLTR+ALT+V copies the image from memory of ShareX and pastes it into Codex WSL, also works on Windows Codex.
Weird a bit that 2 different options to paste.
WSL clean clipboard memory when is Byte array. In WSL we can only paste text. It's for that drag file works, because is transfert link but not work when you paste screenshoot or paste files. But if we use other command CTRL+ALT+V, we can call powershell for transfer clipboard to WSL memory
@Waxime64 But CTRL+ALT+V doesn't work for me either when I have a screenshot in the clipboard :(
Can you take a screenshoot with codex-cli version and you windows version ? And in code-cli, if you press ?, that write CTRL+ALT+V for paste image ?
@Waxime64 Microsoft Windows NT 10.0.26200.0 x64 (Windows 11 Pro) with WSL2 Ubuntu 24.04.3 LTS (GNU/Linux 6.6.87.2-microsoft-standard-WSL2 x86_64) Codex 0.71.0 Windows Terminal 1.23.12811.0
I took a screenshot using the Windows Snipping Tool (no autosave enabled in the settings) – it is now in the clipboard. I then tried to paste it into WSL2 Codex using CTRL + ALT + V: