graphics: the alternate screen shares the primary screen's image store #89

Closed
opened 2026-10-10 04:18:57 +09:00 by natsukium · 0 comments
Owner

felis keeps one image store per session, shared by the primary and alternate screens; only the placements are per screen (the primary's are stashed on ?1049h and restored on ?1049l). kitty keeps a separate graphics manager, images included, for each screen, so nothing a program does to images on the alternate screen touches the primary's.

With a shared store, an image operation on the alternate screen reaches placements stashed for the primary:

  • Re-transmitting an image id on the alternate screen replaces the data the primary's stashed placements draw, so returning shows the new pixels (or, once a re-transmit deletes the image's placements, should drop them), and a stashed U=1 extent is restored against the new image.
  • An uppercase delete on the alternate screen can free an image the primary's stashed placements still use; nothing restores it.
  • An eviction during the alternate-screen stay can leave stashed placements pointing at a missing image (the restore path already filters stale virtual extents for this reason).
  • Stashed placements hold no refs, so the image store's eviction and free decisions do not see them.

Found while reviewing the placement identity and lifetime fixes; an event-driven purge of the stash was tried there and dropped, because frame deletes re-emit Transmit, frees are decided without the stash, and virtual extents need their own rule.

Decide: per-screen image stores as in kitty (daemon, wire and client mirror all change), or keep the shared store and give stashed placements a way to tell their image was replaced or freed (an image generation recorded on each placement and checked on restore, plus counting stashed placements in the free decision).

felis keeps one image store per session, shared by the primary and alternate screens; only the placements are per screen (the primary's are stashed on `?1049h` and restored on `?1049l`). kitty keeps a separate graphics manager, images included, for each screen, so nothing a program does to images on the alternate screen touches the primary's. With a shared store, an image operation on the alternate screen reaches placements stashed for the primary: - Re-transmitting an image id on the alternate screen replaces the data the primary's stashed placements draw, so returning shows the new pixels (or, once a re-transmit deletes the image's placements, should drop them), and a stashed `U=1` extent is restored against the new image. - An uppercase delete on the alternate screen can free an image the primary's stashed placements still use; nothing restores it. - An eviction during the alternate-screen stay can leave stashed placements pointing at a missing image (the restore path already filters stale virtual extents for this reason). - Stashed placements hold no refs, so the image store's eviction and free decisions do not see them. Found while reviewing the placement identity and lifetime fixes; an event-driven purge of the stash was tried there and dropped, because frame deletes re-emit `Transmit`, frees are decided without the stash, and virtual extents need their own rule. **Decide:** per-screen image stores as in kitty (daemon, wire and client mirror all change), or keep the shared store and give stashed placements a way to tell their image was replaced or freed (an image generation recorded on each placement and checked on restore, plus counting stashed placements in the free decision).
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
felis-terminal/felis#89
No description provided.