codex icon indicating copy to clipboard operation
codex copied to clipboard

Image pasting in Windows to WSL in Terminal directly from clipboard

Open PrzemyslawKlys opened this issue 3 months ago • 13 comments

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

PrzemyslawKlys avatar Sep 19 '25 19:09 PrzemyslawKlys

I also have the same problems.

piyalitt avatar Sep 20 '25 07:09 piyalitt

i had the same problem

esdrasrenan avatar Sep 25 '25 11:09 esdrasrenan

Can confirm, same issue. Super annoying to always have to save screenshots and then manually tell codex about them.

Kahitar avatar Sep 28 '25 11:09 Kahitar

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

adal-idl avatar Oct 12 '25 09:10 adal-idl

ctrl + v to paste images not work on WSL on 0.46

Waxime64 avatar Oct 17 '25 03:10 Waxime64

Can confirm. Image pasting not working

krisalcordo avatar Oct 19 '25 01:10 krisalcordo

0.47 still not working

bartlomiejborzucki avatar Oct 20 '25 18:10 bartlomiejborzucki

Pull request: https://github.com/openai/codex/pull/5644

Waxime64 avatar Oct 30 '25 14:10 Waxime64

just upgraded to codex-cli 0.53.0 still not working

adal-idl avatar Nov 01 '25 06:11 adal-idl

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

unclejimao avatar Nov 02 '25 06:11 unclejimao

Same Problemo

CODEGOAT007 avatar Nov 15 '25 01:11 CODEGOAT007

This is the best candidate to get this fixed but the author is still waiting on things

https://github.com/openai/codex/pull/5644

krisalcordo avatar Nov 15 '25 19:11 krisalcordo

Image

Done in 0.66-alpha 2

Waxime64 avatar Dec 04 '25 21:12 Waxime64

@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)

wbdb avatar Dec 09 '25 23:12 wbdb

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?

PrzemyslawKlys avatar Dec 10 '25 07:12 PrzemyslawKlys

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 avatar Dec 10 '25 07:12 PrzemyslawKlys

@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.

wbdb avatar Dec 10 '25 11:12 wbdb

Well i just tested

Image

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.

PrzemyslawKlys avatar Dec 10 '25 11:12 PrzemyslawKlys

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 avatar Dec 10 '25 19:12 Waxime64

@Waxime64 But CTRL+ALT+V doesn't work for me either when I have a screenshot in the clipboard :(

wbdb avatar Dec 11 '25 16:12 wbdb

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 avatar Dec 11 '25 20:12 Waxime64

@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:

Image

wbdb avatar Dec 12 '25 22:12 wbdb