Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: ZWJ paste from clipboard problem (unicode)



On Tue Apr 1, 2025 at 3:23 PM +04, Oliver Kiddle wrote:
> "Daniil Rozanov" wrote:
>> As far as I know it is possible on some bunch of terminals. This
>> possibility called "mode 2027", briefly described here:
>>
>> https://mitchellh.com/writing/grapheme-clusters-in-terminals
>>
>> So at least zsh can test terminal to know does it support grapheme
>> clustering or not and work around this.

> So zsh would need to either depend on some additional external library
> or we need to fetch tables of unicode code points and generate our own
> tables to classify them.

I want to mention that notcurses library has its own approach to handle
unicode symbols and extended grapheme clusters in particular

https://github.com/dankamongmen/notcurses/blob/93a4890f4c2b491cda62fea5110995c6a25691e2/src/lib/egcpool.h#L98

Internally it uses libunistring

https://github.com/gnosis/libunistring

Hope this might be helpful


Daniil Rozanov




Messages sorted by: Reverse Date, Date, Thread, Author