claude-code - 💡(How to fix) Fix Bash tool should support terminal inline images (iTerm2/Sixel/wezterm imgcat) [1 comments, 2 participants]

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…
GitHub stats
anthropics/claude-code#47826Fetched 2026-04-15 06:41:13
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
1
Author
Timeline (top)
labeled ×4commented ×1

Error Message

Works in terminal, fails in Bash tool: "No such device or address (os error 6)"

Root Cause

Rendering LaTeX math equations as inline images in the terminal. A script (teximg) can render LaTeX to a PNG via matplotlib and display it inline using wezterm imgcat. This works when the user runs it directly in their terminal, but fails when Claude runs it via the Bash tool because the image escape sequences never reach the terminal.

Code Example

$ teximg '$\text{Attention}(Q, K, V) = \text{softmax}\left(\frac{QK^T}{\sqrt{d_k}}\right)V$'
# Works in terminal, fails in Bash tool: "No such device or address (os error 6)"
RAW_BUFFERClick to expand / collapse

Problem

Claude Code's Bash tool runs commands in a subprocess whose stdout is captured, not piped to the user's terminal. This means terminal escape-sequence-based features like inline images (wezterm imgcat, iTerm2 image protocol, Sixel graphics) don't work.

Use case

Rendering LaTeX math equations as inline images in the terminal. A script (teximg) can render LaTeX to a PNG via matplotlib and display it inline using wezterm imgcat. This works when the user runs it directly in their terminal, but fails when Claude runs it via the Bash tool because the image escape sequences never reach the terminal.

$ teximg '$\text{Attention}(Q, K, V) = \text{softmax}\left(\frac{QK^T}{\sqrt{d_k}}\right)V$'
# Works in terminal, fails in Bash tool: "No such device or address (os error 6)"

This would also enable other image-in-terminal use cases: charts, diagrams, plots, etc.

Possible approaches

  • Pass through iTerm2/Sixel escape sequences from Bash tool output to the host terminal
  • Detect image escape sequences in Bash output and render them in Claude Code's UI
  • Provide a dedicated tool for displaying images inline

Environment

  • Terminal: WezTerm (supports iTerm2 image protocol)
  • OS: Fedora 43, Wayland

extent analysis

TL;DR

Passing through iTerm2/Sixel escape sequences from Bash tool output to the host terminal may enable inline image rendering.

Guidance

  • Investigate how to configure the Bash tool to pass through escape sequences to the host terminal, potentially by modifying its stdout capture behavior.
  • Consider using a library or tool that can detect and handle iTerm2 image protocol escape sequences, such as wezterm imgcat, to render images in the terminal.
  • Evaluate the feasibility of implementing a dedicated tool for displaying images inline, as an alternative to modifying the Bash tool.
  • Verify that the terminal emulator (WezTerm) is properly configured to support iTerm2 image protocol and Sixel graphics.

Example

No code example is provided, as the issue does not imply a specific code change.

Notes

The solution may depend on the specific implementation of the Bash tool and its interaction with the terminal emulator. Additionally, the use of Wayland as the OS may introduce additional complexity.

Recommendation

Apply a workaround by passing through iTerm2/Sixel escape sequences, as it seems to be the most direct approach to enabling inline image rendering in the terminal.

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