graphics: a placement without p= replaces the image's previous one instead of adding another #78

Closed
opened 2026-10-09 21:51:16 +09:00 by natsukium · 0 comments
Owner

Placements::upsert (crates/felis-grid/src/images.rs) keys placements on (image_id, Option<placement_id>), so every a=p (or a=T) without p= shares one slot per image. Placing the same image twice without a placement id moves the first placement instead of adding a second one. The client shadow (crates/felis-client-core/src/image_shadow.rs) mirrors the same key.

kitty: handle_put_command (kitty/graphics.c) reuses an existing ref only when g->placement_id is non-zero (and the image has a client id). The spec: "Not specifying a placement id or using p=0 for multiple put commands with the same non-zero image id results in multiple placements of the image."

Repro: transmit image 1, then \e_Ga=p,i=1,c=4,r=2\e\\ at one cursor position and the same command at another. kitty shows two copies; felis shows one, at the second position.

Decide: how an id-less placement is addressed afterwards (deletes by position still reach it; d=i without p= removes all of the image's placements). The wire Placement / PlacementRemoved events need a daemon-assigned key for id-less placements so the client can tell them apart.

`Placements::upsert` (`crates/felis-grid/src/images.rs`) keys placements on `(image_id, Option<placement_id>)`, so every `a=p` (or `a=T`) without `p=` shares one slot per image. Placing the same image twice without a placement id moves the first placement instead of adding a second one. The client shadow (`crates/felis-client-core/src/image_shadow.rs`) mirrors the same key. **kitty:** `handle_put_command` (`kitty/graphics.c`) reuses an existing ref only when `g->placement_id` is non-zero (and the image has a client id). The spec: "Not specifying a placement id or using p=0 for multiple put commands with the same non-zero image id results in multiple placements of the image." **Repro:** transmit image 1, then `\e_Ga=p,i=1,c=4,r=2\e\\` at one cursor position and the same command at another. kitty shows two copies; felis shows one, at the second position. **Decide:** how an id-less placement is addressed afterwards (deletes by position still reach it; `d=i` without `p=` removes all of the image's placements). The wire `Placement` / `PlacementRemoved` events need a daemon-assigned key for id-less placements so the client can tell them apart.
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#78
No description provided.