openai / openai/codex

TUI: Support pasting images directly from the system clipboard on Windows

Open
#41,132 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

CLI enhancement TUI windows-os
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

What variant of Codex are you using?

CLI

What feature would you like to see?
Feature request

Please add support for pasting images directly from the system clipboard into the Codex TUI on Windows.

Current behavior

Codex supports image input through the --image (-i) option, but an image copied to the Windows clipboard cannot be pasted directly into the TUI prompt.

Users currently need to:

  1. Save the clipboard image to a file.
  2. Start Codex with codex -i <image-file>, or provide the saved file path afterward.

This interrupts the workflow, especially when sharing screenshots, error dialogs, UI states, and terminal captures.

Other terminal-based AI clients, such as Hermes, can detect an image in the clipboard and attach it directly to the prompt.

Expected behavior

When the clipboard contains an image, pressing Ctrl+V in the Codex TUI should:

  1. Detect the clipboard image, such as PNG, DIB, or bitmap data.
  2. Convert it to a supported image format if necessary.
  3. Attach it to the current prompt.
  4. Display a placeholder or preview such as [Image #1].
  5. Allow the user to remove the attachment before submitting.

Normal text clipboard behavior should remain unchanged.

Suggested implementation

On Windows, the TUI could read image data using the native clipboard APIs and convert formats such as CF_DIB or CF_BITMAP to a temporary PNG attachment.

Ideally, equivalent behavior could also be supported on macOS and Linux.

Environment
  • OS: Windows
  • Shell: PowerShell
  • Codex CLI version: 0.150.1
  • Image input through codex -i <file> works
  • Direct clipboard image paste does not work
Why this matters

Screenshots are commonly used when debugging UI problems, runtime errors, configuration screens, and visual regressions. Direct clipboard image paste would make multimodal
workflows in the Codex TUI significantly faster and more natural.

Additional information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the Codex TUI's Ctrl+V handling and the existing --image/-i input path. Compare how text clipboard data and image attachments are represented, then define coverage for Windows clipboard formats and the expected attachment editing flow. Done means image paste works without changing normal text paste behavior and the requested placeholder, removal, and submission behavior are covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.