Skip to content

Fix hang wrapping OSC-8 hyperlinks with wide graphemes#232

Open
jquast wants to merge 7 commits into
masterfrom
fix/wrap-hyperlink-wide-hang
Open

Fix hang wrapping OSC-8 hyperlinks with wide graphemes#232
jquast wants to merge 7 commits into
masterfrom
fix/wrap-hyperlink-wide-hang

Conversation

@jquast

@jquast jquast commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Supersedes #231 with missing coverage, this statement caused wcwidth.wrap() to loop forever, reported and fixed by @santhreal:

wcwidth.wrap('\x1b]8;;u\x07😀', 1)

santhreal and others added 4 commits July 17, 2026 23:10
When wrap width is 1 and an open hyperlink precedes a wide/emoji
grapheme, the wrap loop never advanced. Advance past the grapheme.
_find_first_visible_break fully supersedes the old force-progress path.
It can't be reached, guarded by conditional before calling
_handle_long_word
@jquast
jquast force-pushed the fix/wrap-hyperlink-wide-hang branch from 05c8dc9 to de55177 Compare July 22, 2026 02:02
@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (614156b) to head (45f66a3).

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #232   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           27        27           
  Lines         1967      1973    +6     
  Branches       462       464    +2     
=========================================
+ Hits          1967      1973    +6     

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

codspeed-hq Bot commented Jul 22, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 10.34%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
✅ 107 untouched benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
test_width_wcswidth_consistency_udhr 489.5 ms 443.6 ms +10.34%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing fix/wrap-hyperlink-wide-hang (45f66a3) with master (614156b)

Open in CodSpeed

@jquast
jquast marked this pull request as ready for review July 22, 2026 02:53
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