-
Notifications
You must be signed in to change notification settings - Fork 61
Description
Hi Jeff,
imho, one of the many problems of getting Emoji widths right is that there are multiple definitions of what an Emoji sequence can look like to be considered an Emoji. The standard defines an recommended set here:
https://www.unicode.org/reports/tr51/#def_rgi_set
but it also defines variations of it (in emoji-test.txt, listed here) and more importantly, allows arbitrary Emoji sequences which are still considered valid.
However, probability is low that non-recommended Emoji will ever gain so much popularity that terminals would need to display them as a single width-2-Emoji, so there will always be the case, that some Emoji sequences should be displayed as an (actual) sequence of separate basic Emoji. That is the reason I made Emoji handling configurable in the latest release of unicode-display_width.
I did some manual testing and was surprised to learn that most terminals (gnome-terminal, vscode terminal etc.) would not display most Emoji sequences (the exception being popular terminals on macOS). I also noted that is very unpleasant to work with software that measures RGI-Emoji sequences correctly, but the terminal displays them as separate Emoji. I am trying to automatically detect the terminal used to provide a good out-of-box experience, but probably, a run-time check (like ucs-detect does) would be more reliable.
Condensing the above remarks into a single question/issue, it would be:
Should wcwidth() / the wcwidth spec support different string width mechanisms for RGI and non-RGI Emoji?