Repository navigation
fix(graphics): move the cursor past an image as the declared terminal does - #615
Merged
Merged
Conversation
… does A terminal that speaks kitty or sixel graphics moves the cursor past an image it places; termlens left it where the image began, and DESIGN.md said neither protocol moves it. The emulator now follows the terminal the test declared with graphics() and cell_size(): - kitty: onto the placement's last row, one column past its right edge, wrapping past the screen's edge and scrolling past the bottom margin, unless C=1, U=1 or P= says otherwise. The size in cells is c= and r=, or kitty's own arithmetic (update_dest_rect) over the source rectangle and the cell size; a=p finds its image's size by id in the payload log. - sixel: to the image's last text row, the column kept, as xterm does with sixel scrolling on; the height is the larger of the raster's and the painted one, measured before a payload past the capture bound is dropped. - Graphics::None, the default, moves nothing, as a terminal without the protocol ignores the escape. The facts the move needs travel beside the payload, not in it, so the JSON shape is unchanged. A kitty transmission naming no action is now a=t, transmit only, the protocol's default; it was reported as placed, which would also have moved the cursor for images kitty never shows. Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A terminal that speaks kitty or sixel graphics moves the cursor past an image it places. termlens left the cursor where the image began, so text an application wrote after an image landed on top of it.
docs/DESIGN.mdalso said that neither protocol moves the cursor.The emulator now follows the terminal the test declared with
graphics()andcell_size():C=1,U=1orP=says otherwise. The size in cells comes fromc=/r=. Without them it comes from kitty's ownupdate_dest_rectarithmetic over the source rectangle and the cell size.a=plooks up its image's size by id in the payload log.Graphics::None, the default, still moves nothing, as a terminal without the protocol ignores the escape.The facts the move needs (a crate-internal
Placement) travel beside the payload, not inside it, so the JSON shape is unchanged.A kitty transmission that names no action is now
a=t(transmit only), which is the protocol's default. It used to be reported as placed, which would also have moved the cursor for images kitty never shows.LIMITATIONS.md says what is not modelled: sixel display mode
?80, xterm's extra scroll for a trailing-,?8452, and a PNG placed withoutc=/r=.Tests
emu/vt100.rs:graphics.rs:kitty_cellsagainst kitty's arithmetica_declared_kitty_terminal_moves_the_cursor_past_a_placementintests/graphics.rs. It adds a PTY test, so stress is needed.Closes #588
Signed-off-by: Vyncint Ng 115854244+vyncint@users.noreply.github.com