Repository navigation
Conversation
Fixes vyncint#845 Signed-off-by: Álvaro Alonso <242080768+alvaroalonsoparrondo-a11y@users.noreply.github.com>
vyncint
previously approved these changes
Nov 27, 2026
vyncint
left a comment
Owner
There was a problem hiding this comment.
Reviewed against the issue; CI is green. Thank you.
Combine the range check with vyncint#873's colour-space match: a component over 100 is ignored inside the RGB arm. Keep both tests, and the CHANGELOG entries without a blank line between them. 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.
Fixes #845
decode_sixelapplied#Pc;2;Pr;Pg;Pbwhatever its components, andpercentclamped each one to 100. xterm checks the components first: an RGB component over 100 is aDATA_ERRORthat returns beforeupdate_color_register(graphics_sixel.c:788-793), so the register keeps its colour. An encoder that writes 0-255 values gets its image in the registers' earlier colours on xterm, and termlens decoded it in other ones.crates/termlens/src/graphics.rs: an RGB definition is applied only when all three components are 100 or less; otherwise it is ignored and the register stays as it was. The register is still selected.percentkeeps its clamp, with a comment that a definition over 100 no longer reaches it.$in the issue's example). Here the$is still read as a graphics carriage return; as the issue says, at the left margin that changes nothing, so I left it alone.a_colour_with_a_component_over_100_is_ignoredis the issue's case (register 1 defined blue, then#1;2;150;0;0): the three columns are blue. It also checks that 100 itself still applies. Without the guard it fails with the issue'sleft: [[255, 0, 0, 255], ...].This touches the lines next to #873 (#846), so whichever merges second will need a small rebase; I can do it.
Checked on macOS:
cargo fmt --all --check,cargo clippy -p termlens --all-targets --all-features -- -D warnings, the sixel colour tests incargo test -p termlens --features decode --lib,check-dco.shandcheck-no-ai-attribution.sh.Álvaro Alonso
242080768+alvaroalonsoparrondo-a11y@users.noreply.github.com