Inline Images in Codex Replies: Which Terminals Draw Them, and Why the Rest See Only Alt Text

Inline Images in Codex Replies: Which Terminals Draw Them, and Why the Rest See Only Alt Text

Codex’s TUI can now draw a local image inside an assistant reply. If the model answers with ![Build chart](./chart.png), a capable terminal shows the chart in place of the label. The idea in our backlog framed this as “iTerm2, Kitty and WezTerm yes, macOS Terminal.app no”, and as an open bug about a dropped fallback. Reading the code and the issue gives a more precise picture: the supported protocols are Kitty graphics and Sixel, the “bug” was closed as intended behaviour, and several conditions have to hold before a preview appears.

A note on sourcing. The code below is the openai/codex main branch at commit 7f7a1aa (2 December 2026).1 The feature arrived in pull request #64254, merged 27 November 2026.2 I did not run Codex in any terminal for this article, so what follows describes what the code decides, not what any terminal then does with it. The third-party release summary named in the backlog was not read.


What Was Added

The pull request description is short. Markdown image references in replies used to show only their alt text. The change shows previews “in place of alt text in rich transcript views on supported terminals, including in side conversations”, confirms the conversation uses a local workspace before loading visible images off the render thread, and “keep[s] alt text as the fallback when a preview is unavailable”, preserving it for copying and Find.2

The markdown renderer is where a reference is recognised. For an image tag it resolves the destination to an absolute local path and records a marker (path plus label range) on the line. It does so only for the outermost image, not inside a table cell, and not when the image sits inside a link.3 The destination must look like a local file path: no query string, no remote host in a file:// URL, no leading ~, no control characters, and a length under 8,192 bytes.4 A remote https:// image is therefore never fetched. It stays alt text.

flowchart TD
    A["Reply contains ![alt](path)"] --> B{Local, path-shaped destination, not in table or link?}
    B -- no --> Z[Alt text only]
    B -- yes --> C{Rich view and terminal protocol detected?}
    C -- no --> Z
    C -- yes --> D{Local workspace and local environments only?}
    D -- no --> Z
    D -- yes --> E[Load and decode in background]
    E --> F{Decodes within limits?}
    F -- no --> Z
    F -- yes --> G[Preview replaces the label]

Which Terminals

Detection lives in the same module that decides whether the terminal pets can show, and the TUI reuses its answer for previews.5 The rules, in order:

Environment Result
tmux Unsupported, with an exception below
Zellij Unsupported (“terminal images don’t stay reliably pane-local”)
Kitty (KITTY_WINDOW_ID), WezTerm, Ghostty, Rex Kitty graphics protocol
iTerm2 3.6 or newer Kitty protocol, sent as a local-file reference
iTerm2 older than 3.6 Unsupported (“upgrade required”)
Windows Terminal, or a TERM containing sixel, mlterm or foot Sixel
Anything else, including terminals the code does not recognise Unsupported

Two corrections to the backlog framing follow. iTerm2 is supported, but only from 3.6, and through the Kitty protocol rather than its own image protocol. And macOS Terminal.app is not named anywhere, so it falls into “anything else” and gets alt text. That is an inference from the detector, not a test.

Detection can be overridden by a probe. If the TUI has probed the terminal for Kitty graphics, a positive answer selects Kitty and a negative answer disables previews, whatever the environment variables said.6 Inside tmux, the unsupported verdict is lifted only when Codex runs fullscreen with tmux’s allow-passthrough all set, through Kitty virtual placements, and the shared renderer currently emits marks for at most six rows there.57


The Conditions That Are Easy to Miss

Local only. Previews load only when the app server target is not a remote workspace and every environment is local.6 The loader also asks, for each request, whether the thread’s workspace is local; a refusal is remembered and not retried each frame.8 The recent change in #65079 states the same rule for inspected images.9

Rich view only. Requests are skipped unless the transcript is in rich rendering mode.10 The maintainers’ reply on the issue mentions /raw, which shows the unrendered text.11

Supported formats. The helper that decides whether a path is an image accepts PNG, JPEG, GIF and WebP by extension.12 I did not check whether animated GIFs animate; the preview code paints a still raster.

Size and cost. Decoding runs on a background worker and requests a redraw when ready, so a large file does not stall rendering. Decode work is capped at a 32 MiB allocation budget, with a downscaled JPEG fallback for files whose decoded pixels would exceed it, and previews are bounded to 768 pixels on the longest edge.913 Only images near the visible rows are requested, and the preview cache holds a fixed number of entries.8 The Sixel path is further limited to a 160 by 80 pixel budget, and needs the terminal’s cell size, so without it a Sixel preview is not attempted.14


The Fallback Is Alt Text, and That Is Deliberate

Issue #64550 reported that when a terminal cannot draw an image, the TUI prints only the alt text, with no path. The reporter asked for a local-file link or the path as readable text.15 A maintainer closed it as “expected behavior”, “not planned”: the alt text comes straight from the Markdown in the reply, #64254 kept it as the fallback on purpose, and “making the alt text clickable would be a useful enhancement”. The workarounds offered were running /raw to see the path in an existing reply, and, for future replies, asking Codex to add a regular link alongside the image.11

That makes the practical advice concrete. If you work in a terminal that may not draw images, put this in your instructions or prompt rather than hoping for a fix:

When you reference a generated image, also give a plain link:
![Build chart](./chart.png) and [chart.png](./chart.png)

The text-only layout still keeps the label for copy and Find, because the renderer records the label range separately from what is painted.23


What to Take From This

  1. Check your terminal against the table. Kitty, WezTerm, Ghostty and iTerm2 3.6+ use Kitty graphics. Windows Terminal and some Sixel terminals use Sixel. tmux and Zellij are the usual reasons it does not work.
  2. Expect it to be local-only. Remote workspaces and non-local environments get alt text.
  3. Keep a text path in the reply. The fallback has no path, by design.
  4. Use workspace-relative paths without a query string. Anything that is not a plain local path is left as text.
  5. Do not rely on it for review of images that matter. A preview is capped at 768 pixels on its longest edge, so open the file for detail.

What This Article Does Not Establish

  • It does not establish behaviour in a real terminal. No terminal was run, and Terminal.app is an inference.
  • It does not establish the contents of any stable release. The code read is main at 7f7a1aa; the backlog says the feature shipped in the 0.174.0 alphas, and I did not verify the tag it first appeared in.
  • It does not test animated GIF behaviour, very large Sixel output, or the tmux fullscreen path.
  • Whether the maintainers later add a clickable fallback is not known; the issue says only that it would be useful.

  1. openai/codex at commit 7f7a1aa, the head of main on 2 December 2026. Source paths below are under codex-rs/tui/src/ at that commit. ↩

  2. openai/codex#64254, “Render local Markdown images inline in TUI replies”, merged 27 November 2026. ↩ ↩2 ↩3

  3. markdown_render.rs, Tag::Image handling in start_tag and TagEnd::Image in end_tag; markdown_copy.rs, MarkdownImage. ↩ ↩2

  4. markdown_render/local_links.rs, local_image_path and sidebar_file_link. ↩

  5. terminal_capabilities/images.rs, detect_pet_image_support, image_support_for_terminal_environment, pet_image_support_for_terminal and PetImageUnsupportedReason. ↩ ↩2

  6. app.rs, preview_image_protocol (tui.probed_kitty_graphics) and prepare_frame_images (uses_remote_workspace, has_only_local_environments). ↩ ↩2

  7. sidebar_image.rs, SidebarImage::paint, the comment on tmux Kitty virtual placements and the six-row limit. ↩

  8. transcript_view/image_requests.rs, TranscriptImages::request and the CACHE_SIZE eviction. ↩ ↩2

  9. openai/codex#65079, “Load TUI image previews in the background and downscale large JPEGs”. ↩ ↩2

  10. transcript_view.rs, request_visible_images (self.mode != HistoryRenderMode::Rich). ↩

  11. openai/codex#64550, maintainer reply and closure as “not planned”, 29 November 2026. ↩ ↩2

  12. sidebar_image.rs, supports_path and supported_format. ↩

  13. image_decode.rs, MAX_PREVIEW_EDGE and decode_preview (32 MiB max_alloc). ↩

  14. transcript_image.rs, the Sixel size constants; transcript_view/layout.rs, the cell_size().is_some() condition for Sixel. ↩

  15. The issue text of #64550 (reporter’s reproduction and expected behaviour), same URL as 11. ↩