Image paste only works after pasting text first on Linux/X11

Resolved 💬 0 comments Opened May 20, 2026 by BlueCakee Closed May 20, 2026

What version of Codex CLI is running?

codex-cli 0.132.0

Install method

Global npm package: @openai/codex

Platform

  • OS/session: Deepin desktop, X11
  • Terminal: reproduced in multiple terminal emulators, including JetBrains-JediTerm
  • Shell: bash
  • TERM=xterm-256color
  • Locale: zh_CN.UTF-8
  • Input method environment:
  • GTK_IM_MODULE=fcitx
  • QT_IM_MODULE=fcitx
  • XMODIFIERS=@im=fcitx

Problem summary

Image paste does not work immediately after starting a Codex CLI interactive
session. This is not limited to JetBrains-JediTerm; the same behavior is
observed across multiple terminal emulators on the same Linux/X11 desktop
environment.

However, if I paste any text string first, then copy an image and paste it into
the same session, the image paste succeeds.

This looks like a TUI input or Linux/X11 clipboard/paste-channel
initialization issue: the first text paste appears to change the session state
so that subsequent image paste events are recognized.

Steps to reproduce

  1. Start a new interactive codex session.
  2. Copy an image to the system clipboard.
  3. Paste into the Codex CLI input area with Ctrl+V or terminal paste.
  4. Observe that no image is attached.
  5. Copy and paste any plain text string into the Codex CLI input area.
  6. Copy an image to the system clipboard again.
  7. Paste into the same Codex CLI session.
  8. Observe that the image is now attached successfully.

Expected behavior

The first direct image paste should be recognized and attached without requiring
an earlier text paste.

Actual behavior

The first image paste is ignored or not attached. Image paste starts working
only after a text paste has happened in the session.

Impact

This adds friction to workflows that depend on screenshots, including UI
debugging, frontend review, terminal error screenshots, and visual regression
investigation.

Related issues

Workaround

Paste a short text string first, then copy and paste the image again.
Alternatively, save the image as a file and pass it with codex -i /path/to/image.png.

View original on GitHub ↗