Re: ZWJ paste from clipboard problem (unicode)

Mikael Magnusson <[email protected]>
Newsgroups gmane.comp.shells.zsh.user
Message-ID <CAHYJk3Tg7LL2AwjX0CD=CgM2fOVZuiQd85a3TOAyhPB1h9vABw@mail.gmail.com>
On Mon, Mar 31, 2025 at 11:23 PM Daniil Rozanov <[email protected]> wrote:
>
> On Mon Mar 31, 2025 at 11:31 PM +04, Bart Schaefer wrote:
> > On Mon, Mar 31, 2025 at 12:13 PM Daniil Rozanov <[email protected]> wrote:
> >>
> >> When trying to paste "👩" (U+1F469 U+1F3FB U+200D U+1F9B0) emoji, zsh
> >> prints two emojis and "<200d>" in between.
> >
> > Try "setopt combining_chars"
> >
> > Additional tweaks may be needed if your terminal is using bracketed paste mode.
>
> Thanks! Now it pastes pretty emoji. But now there is another problem,
> which is character's width is more than expected. And with some special
> emojis it works wrong: duplicated display on paste, backspase erases
> kinda parts of emoji instead of remove it all at once. Btw this
> behaviour now is similar to bash.
>
> Maybe zsh has some group of settings which handle unicode?

What you want is not theoretically possible as far as I know.
Combining emojis is optional according to the specs, and zsh has no
way of knowing if a terminal will combine two particular emoji in a
zwj sequence, and thus has no idea how wide the sequence of characters
will be or when the terminal will start drawing on a new line.


--
Mikael Magnusson
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.