Skip to content

Support for "Hybrid" semi-/colon SGR parameters - #327

Merged
jquast merged 10 commits into
masterfrom
pr-321-review
Nov 13, 2026
Merged

jquast merged 10 commits into
masterfrom
pr-321-review

Conversation

@jquast

@jquast jquast commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

This supersedes #321. I studied kitty and xterm parsing about this small possible deviation from ECMA-48/ITU T.416/etc. standards, and those changes have been simplified (WCWIDTH_SGR_MAX_PARAMS was removed, malloc/realloc/free removed), while also supporting "hybrid" sequences found to be supported in at least xterm and kitty, and it brings coverage of the changed code up to 100%

Note that #321 was likely created by AI Analysis, that these are probably Unlikely sequences, but, because I discovered code in xterm and kitty that attempts to support them, it is presumed that some misbehaving TUI program or library somewhere must have drove them into the more complex accommodation.

anticipate218 and others added 6 commits November 12, 2026 03:22
Apply accumulated integer SGR parameters before each following colon color. Preserve valid reset/color ordering through the C-backed propagation and clipping APIs, with native and Python regression coverage.

Assisted-by: OpenAI Codex
Comment thread tests/test_sgr_state.py Fixed
@codspeed

codspeed Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

1 warning

⚠️ Upgrade your CodSpeed plugin for Python 3.15

pytest-codspeed 5.0.3 is only tested on Python 3.9, 3.10, 3.11, 3.12, 3.13, and 3.14, so your Python 3.15 measurements may be inaccurate. Upgrade pytest-codspeed to 5.0.4 or later.

See affected benchmarks

✅ 146 untouched benchmarks


Comparing pr-321-review (8929a3d) with master (7eceab9)

Open in CodSpeed

@codecov

codecov Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.96855% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.46%. Comparing base (37deca7) to head (8929a3d).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
libwcwidth/src/sgr.c 96.09% 0 Missing and 5 partials ⚠️
libwcwidth/src/textwrap.c 83.33% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #327      +/-   ##
==========================================
+ Coverage   90.07%   91.46%   +1.39%     
==========================================
  Files          44       44              
  Lines        6447     6388      -59     
  Branches     1810     1806       -4     
==========================================
+ Hits         5807     5843      +36     
+ Misses        241      164      -77     
+ Partials      399      381      -18     

☔ 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.

@jquast

jquast commented Nov 13, 2026

Copy link
Copy Markdown
Owner Author

More coverage will be provided in an upcoming branch

@jquast
jquast merged commit 1585e45 into master Nov 13, 2026
35 checks passed
@jquast
jquast deleted the pr-321-review branch November 13, 2026 17:12
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.

3 participants