Perfecting Terminal Character Width Using Correction Tables
Measuring terminal Unicode width has always been a difficult problem. Per-terminal correction tables make near-perfect accuracy possible. In past years, I have published a specification of Python wcwidth, and Kovid Goyal has published "The algorithm for splitting text into cells" as part of the Kitty Text Sizing protocol. Terminal emulator authors have agreed to disagree on many broad interpretations of Unicode standards, such as whether emoji should be supported at all, down to the very fine details of individual codepoints, categories, and grapheme widths.