Bugfix "standalone emoji" by wcwidth grapheme integration#3956
Bugfix "standalone emoji" by wcwidth grapheme integration#3956jquast wants to merge 2 commits intoTextualize:masterfrom
Conversation
7635ba9 to
95586ff
Compare
|
Regarding multiple unicode versions, I do think support for them should be removed. Six years ago I wrote about the need for and implemented Although it is possible to introspect each terminal, as the ucs-detect tool does, to test against and curate "prediction tables" to absolutely match all terminals, supporting or not, eg. The python wcwidth library specifications very closely matches the kitty specification and is maintained with the help of community to match development of actively maintained terminal emulators. The nightly of ghostty matches this specification very closely and has a perfect score with ucs-detect tool, as pictured in the "After" screenshot, above without error. |
95586ff to
43d6954
Compare
Type of changes
AI?
Checklist
Description
Add
wcwidth>=0.5.3as a runtime dependency, and replace Rich's custom code generation and grapheme splitting / width logic measurement with wcwidth.width(), iter_graphemes(), and clip().Most importantly this fixes some eastern languages with complex combining rules (Virama, Hangul), "standalone" emojis skin tones, standalone "regional indicators", skin tones), but also eliminates ongoing maintenance of custom Unicode logic.
Before
Konsole:

Ghostty:

After
Konsole:

Ghostty:
