Skip to content

Kitty overlay width truncates image sequence (blank overlay) #8

@tmustier

Description

@tmustier

Summary

Dynamic overlay width based on image columns caused Kitty image sequences to be truncated by overlay compositing. Result: overlay clears the background rectangle but the game image is not visible.

Findings

  • Overlay compositing in pi-tui truncates each overlay line to overlay width.
  • Kitty image line contains raw ESC_G...ESC\\ sequence.
  • visibleWidth() does not treat ESC_G as zero-width, so the compositor slices the escape sequence mid-stream.
  • Kitty ignores the truncated sequence → cleared overlay region with no image.
  • Previously the overlay width was 90%, which was wide enough to keep the full ESC_G sequence, so the image rendered (but occluded background).

Steps

  1. Use image renderer in Kitty.
  2. Set overlay width to the exact image columns.
  3. Overlay clears background, image disappears.

Short-term fallback

  • Keep overlay width at 90% (restores image but keeps occlusion).

Proper fix (upstream)

  • In pi-tui: treat ESC_G...ESC\\ as zero-width in visibleWidth()/extractAnsiCode() or skip truncation for image lines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions