8 days ago
- Terminals traditionally used a fixed-size cell grid and mapped each byte to a cell, but this approach fails with modern multi-codepoint characters like emoji.
- Grapheme clustering is necessary to properly handle user-perceived characters composed of multiple codepoints, such as emoji or Arabic letters.
- Most terminal emulators and programs still rely on wcwidth, which can give incorrect width values (e.g., 4 cells instead of 2 for certain emoji).
- Mode 2027 is a proposed standard for terminals to support grapheme clustering, allowing programs to enable or disable it and query support.