codex - 💡(How to fix) Fix Treat pasted image paths as literal text in shell mode [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fixed

Code Example

/path/to/image.png

---

!open-image /path/to/image.png
RAW_BUFFERClick to expand / collapse

What variant of Codex are you using?

cli

What feature would you like to see?

TLDR for humans: converting image paths to [Image] is not useful when in shell mode, so it is possible to disable this behavior with an additional 'if' statement.

Feature request

When the TUI composer is in shell mode, pasted image paths should be inserted as literal text instead of being converted into image attachments.

Motivation

In normal chat mode, converting a pasted local image path into an image attachment is useful.

In shell mode (! prefix), the input is intended to be passed to the shell. In that context, converting a pasted path like:

/path/to/image.png

into:

[Image #1]

makes shell commands harder to use. For example, if Codex generates an image path and I want to open or inspect it from shell mode, I expect to type:

  !open-image /path/to/image.png

and have the path remain literal.

Proposed behavior

When the composer is in shell mode, image-path paste handling should be skipped and the pasted text should be inserted directly into the command buffer.

Normal chat-mode image paste behavior should remain unchanged.

Proposed implementation

The image-path conversion path can be gated on shell mode, roughly:

image_paste_enabled && !is_bash_mode

I have a small branch with a regression test here:

https://github.com/cauldron26/codex/tree/codex/fix-shell-mode-image-path-paste

Validation

  • RUST_MIN_STACK=8388608 cargo test -p codex-tui pasting_filepath --lib
  • Manual TUI check: in shell mode, pasting a PNG path keeps the path literal instead of converting to [Image #1]

Additional information

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Treat pasted image paths as literal text in shell mode [1 pull requests]