bugfix: restore ITU T.416 colon-format colors with colon separators - #243
Merged
Merged
Conversation
_sgr_state_to_sequence() joined the parsed color parameters with ';'.
A colon-format color carries the T.416 colour space element
(38:2:<cs>:R:G:B) that the legacy 38;2;R;G;B form has no slot for, so
the restored sequence shifted R, G and B one position and left a
trailing parameter, which reads as SGR 0.
>>> wcwidth.wrap('\x1b[38:2::255:0:0mred text', width=4)[1]
'\x1b[38;2;0;255;0;0mtext\x1b[0m'
Feeding that prefix back to _sgr_state_update() yields foreground=None:
the color is lost, and the trailing 0 also clears any bold/underline in
the same restoration sequence.
Co-authored-by: Claude <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #243 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 27 27
Lines 1976 1980 +4
Branches 463 464 +1
=========================================
+ Hits 1976 1980 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jquast
force-pushed
the
fix-sgr-colon-color-restore
branch
from
September 14, 2026 19:43
3311751 to
093a232
Compare
jquast
added a commit
that referenced
this pull request
Sep 17, 2026
Packaging: Drop ucs-detect/data/*.yaml from sdist, this is almost 25MB unpacked and will only grow. If any downstream re-distributors wish to re-execute "tox -e update", then, they can use our git repository, tags, and git submodules. For python sdist, the ability to "build from source", there is no need to include 25MB of data used for a code generation step that is not typically executed. libwcwidth: - bugfix clip() and boundary_after(). Similar fix as #243 but implemented in C11. - bugfix GB9b: boundary_before() recursed on the Prepend's byte offset.
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.
small docfixes added to #239. Closes #239