Skip to content

bugfix: restore ITU T.416 colon-format colors with colon separators - #243

Merged
jquast merged 3 commits into
masterfrom
fix-sgr-colon-color-restore
Sep 14, 2026
Merged

jquast merged 3 commits into
masterfrom
fix-sgr-colon-color-restore

Conversation

@jquast

@jquast jquast commented Sep 14, 2026 •

Copy link
Copy Markdown
Owner

small docfixes added to #239. Closes #239

dylanpulver and others added 2 commits September 1, 2026 22:02
_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

codecov Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (17986f5) to head (093a232).
⚠️ Report is 1 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed

codspeed Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 108 untouched benchmarks


Comparing fix-sgr-colon-color-restore (093a232) with master (17986f5)

Open in CodSpeed

@jquast
jquast force-pushed the fix-sgr-colon-color-restore branch from 3311751 to 093a232 Compare September 14, 2026 19:43
@jquast
jquast merged commit 1e6b48d into master Sep 14, 2026
30 checks passed
@jquast
jquast deleted the fix-sgr-colon-color-restore branch September 14, 2026 19:44
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants