Skip to content

Kitty graphics: Track placements independently from text cells #6132

Description

@anthonykim1

Follow-up to #5860 and #6131.

The current Kitty graphics implementation stores displayed image tiles in the same cell-backed ImageStorage used by sixel and IIP. PR #6131 restores HAS_EXTENDED as the authoritative indication that a cell still contains active image data. This is correct for sixel/IIP and prevents stale _extendedAttrs from hiding newly written text, but it also makes the current Kitty implementation use WezTerm-style overwrite behavior: writing text evicts the Kitty tiles in those cells.

Kitty graphics uses independent image placements. A placement with negative z is drawn below text, while the default non-negative z is drawn above text. Writing text into the same cells should not delete the placement. Also, C=1 only disables cursor movement after placement; it is not a layering flag.

Proposed direction

  • Store Kitty placements independently from the text grid and from sixel/IIP cell tiles.
  • Track each placement image ID, placement ID, source rectangle, destination geometry, offsets, z-index, and buffer anchor.
  • Render negative-z placements below text and non-negative-z placements above text without consulting stale _extendedAttrs.
  • Keep scrolling, resizing, image retransmission, and placement deletion consistent with the stored placement records.
  • Do not restore the stale-cell fallback removed by Restore text overwrite of image tiles #6131.

Acceptance criteria

  • a=T and a=p create independent placement records.
  • Writing text across a non-negative-z placement does not delete it; the image remains above the new text.
  • Writing text across a negative-z placement leaves the placement below the visible text.
  • Deleting or replacing a placement removes only the intended placement/image data.
  • Integration tests cover text writes over both negative and non-negative z-index placements.

Related KGP work remains tracked separately in #5710 (delete selectors), #5711 (Unicode placeholders), and #5712 (relative placements).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions