Skip to content

tui: transcript images and image viewer render garbled, underscaled blocks (Termux, no graphics protocol) #52492

Closed as not planned

Description

@DEAD1nsane

Description

Images shown in the TUI — inline in the transcript and in the full-screen image viewer — render as tiny, garbled clusters of block characters instead of a recognizable picture. The viewer is the stronger evidence: it has the entire viewport available but leaves most of the screen black and still displays the image as a small illegible smear.

Expected: transcript images should render as a recognizable low-resolution fallback (unicode half-blocks — Termux supports no kitty/sixel); the viewer should scale the image to fit the viewport (portrait images should use full terminal height, centered).

Actual: transcript shows scrambled colored blocks with no recognizable structure; the viewer shows the same garble in the upper-left while the rest of the viewport stays black — it never scales up. The blocks also look structurally scrambled rather than like a clean downsample.

Notes: sources are normal portrait Termux screenshots (~1080px wide). Even allowing for geometry (a portrait image in 80x24 can only be ~22 cells wide via half-blocks), the output should still be a clean downsample, and the viewer should maximize within the viewport. Relevant config: "session": { "image_preview": false }, "prompt": { "image_preview": true } — transcript still displays image content despite the former being false; unclear which setting governs this path. Possible areas: the unicode fallback downscaler (sampling/stride for tall images) and the viewer's fit/scale calculation.

Related: #41691 (blank thumbnail on Fedora/herdr, next channel) — possibly the same broken renderer manifesting differently. No Termux/Android-specific rendering issue was found.

Plugins

notify.js, envsitter-guard.v2.js (auto-loaded from ~/.config/opencode/plugins/)

OpenCode version

v2.0.21 (official v2 Node.js musl build on Termux)

Steps to reproduce

  1. On Termux (or any terminal without kitty/sixel support), start opencode v2.0.21
  2. Attach a portrait phone screenshot to a prompt ("prompt": { "image_preview": true }) or open one via the image viewer
  3. Observe the transcript rendering and/or open the full-screen viewer

Screenshot and/or share link

Image viewer — full frame (tiny garbled render in a mostly-black viewport):

Image viewer: garbled image rendered tiny in upper-left, rest of viewport black

Transcript, cropped to the inline image block — scrambled, not a recognizable downsample:

Transcript inline image: scrambled colored blocks, illegible

(Full-resolution sources available on request.)

Operating System

Linux 6.12.81-android16 (aarch64 Android / Termux)

Terminal

Termux — TERM=xterm-256color, COLORTERM=truecolor, 80x24. No graphics protocol (no kitty/sixel), so the unicode block fallback path is what gets exercised.

Activity

  1. added
    needs:compliance
    and removed
    needs:compliance
    on Oct 1, 2026
  2. github-actions commented on Oct 1, 2026

    @github-actions
    Contributor

    Thanks for updating the issue with the required details and reproduction steps!

  3. opencodejr commented on Oct 28, 2026

    @opencodejr
    Contributor

    Thanks for the detailed report and the screenshots. I couldn't reproduce this on v2.0.21 in a terminal without kitty/sixel support (tmux, TERM=xterm-256color, COLORTERM=truecolor, 80x24), so the unicode block fallback was used as on Termux:

    • I attached a 1080x2340 portrait PNG with a red top band, colour bars in the middle and a blue bottom band, by pasting its file path into the prompt.
    • The prompt thumbnail showed a clean, recognisable downsample. It's centre-cropped on purpose because the thumbnail box is landscape.
    • The full-screen viewer (Ctrl+P → "View image attachments") scaled the image to the full available height (about 16 rows at 80x24) and centred it horizontally. Nothing was garbled or left small in the upper-left.

    So this may be specific to how Termux answers the terminal capability or size queries that the TUI sends at startup. These would help narrow it down:

    1. Does it also happen with a simple test image, e.g. a few large solid colour bands, instead of a phone screenshot?
    2. Does it happen inside tmux on Termux, and on a newer release (e.g. 2.2.0, which the TUI suggests via /update)?
    3. How did you attach the image (pasting a path, clipboard paste, or something else)? And does resizing the terminal or zooming the Termux font change the result?

    On the settings: prompt.image_preview controls the thumbnails in the prompt box and session.image_preview controls the images in sent messages. With session.image_preview: false, the image you saw was most likely the prompt's attachment preview.

    Related: #41691 (blank image thumbnail on Fedora/herdr). It's the same preview component but shows a different symptom.

  4. DEAD1nsane commented on Oct 28, 2026

    @DEAD1nsane
    Author

    Thanks for looking into this!

    To answer your questions:

    1. I can try with a simple test image (solid color blocks) to see if it's image-specific
    2. I haven't tried in tmux yet, will test that
    3. I'm on the latest Termux from F-Droid (recent release)
    4. I attached the image by pasting the file path into the prompt

    I'll try these and report back. The workaround with prompt.image_preview is helpful to know - I'll use that for now.

  5. opencodejr commented on Oct 31, 2026

    @opencodejr
    Contributor

    I'm closing this for now, since we couldn't reproduce it and haven't heard back with the details we asked for. On v2.0.21 in a terminal without kitty/sixel support (80x24, xterm-256color, truecolor), both the prompt thumbnail and the full-screen viewer drew a clean, correctly scaled image using the block fallback. That makes a Termux-specific cause likely, but we can't confirm it without more information.

    If it still happens, please reply here with:

    • whether a simple test image (a few large solid colour bands) also comes out garbled,
    • whether it happens inside tmux on Termux or on a newer release,
    • how you attached the image.

    We can reopen once we have those. Thanks again for the detailed report and screenshots.

  6. neriousy commented on Nov 19, 2026

    @neriousy
    Member

    I re-checked this after the earlier automatic close was reverted. We still can't reproduce garbled block images or an unscaled viewer in a terminal without kitty/sixel, so it's likely specific to how Termux answers the size and capability queries. If it still happens on the latest version, reply with a screenshot using a simple solid-colour test image and whether it also happens inside tmux on Termux, and we'll reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions