failed NO_PATCH NO_PATCH UNSUBMITTED empty_patch(None) · None tool calls · 0 s · Textualize/rich
Handle graphemes Rich has never handled multi-codepoint emoji, because terminals were highly inconsistent about how they were rendered. And there was no way to know in advance how wide a given collection of codepoints was going to be. This is technically still the case. However modern terminals are more consistent now, and they tend to follow unicode rules. Which means that Rich can also follow those rules and get it right more of the time. This PR uses the data from https://github.com/jquast/wcwidth to calculate widths in the same way. I didn't use wcwidth directly, as Rich has more complex requirements. Calculating the width of a string is not enough, if you want to do wrapping, cropping etc. This PR adds the capability to split strings in to sequences that produce a single glyph in the terminal. And that is used in a few low-level functions. The data is stored in a way that keeps startup time low, and makes width calculations more optimal than wcwidth. This iteration should hopefully offer similar performance to the earlier versions. In the nearish future there will be a Rust library to speed up some of the lower level operations. Fixes https://github.com/Textualize/rich/issues/3897
| # | Tool | Arguments | Result |
|---|---|---|---|
| No trace captured. | |||