Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: ZWJ paste from clipboard problem (unicode)
- X-seq: zsh-users 30246
- From: "Daniil Rozanov" <personal@xxxxxxxxxxxx>
- To: "Oliver Kiddle" <opk@xxxxxxx>
- Cc: "Mikael Magnusson" <mikachu@xxxxxxxxx>, "Zsh users" <zsh-users@xxxxxxx>
- Subject: Re: ZWJ paste from clipboard problem (unicode)
- Date: Tue, 01 Apr 2025 22:17:39 +0400
- Archived-at: <https://zsh.org/users/30246>
- In-reply-to: <33942-1743506608.001547@3ros.h6PJ.3Nhw>
- List-id: <zsh-users.zsh.org>
- References: <D8UOVIME9HDS.1I0WLZVJ6FPQ7@rozanov.info> <CAH+w=7atQJ9Hqp=MXpin3CMQ=N_=fvhYs1aWfFh2fpHNLbEvzg@mail.gmail.com> <D8URMP63LOAZ.35Q236JMFWTLZ@rozanov.info> <CAHYJk3Tg7LL2AwjX0CD=CgM2fOVZuiQd85a3TOAyhPB1h9vABw@mail.gmail.com> <D8V5D34J1TWE.3QJ3E59BL2J8X@rozanov.info> <33942-1743506608.001547@3ros.h6PJ.3Nhw>
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