Re: Pasting multi-codepoint glyph breaks it into two

Mikael Magnusson <[email protected]>
Newsgroups gmane.comp.shells.zsh.user
Message-ID <CAHYJk3Q=xdQxX4mYm3w9qDt3URF6dPfDPuKHyo96nAbqHKH2NA@mail.gmail.com>
On Thu, Feb 27, 2025 at 1:30 PM Hugo Osvaldo Barrera <[email protected]> wrote:
>
> Hi all,
>
> When I paste a multi-codepoint glyph (or insert it via an input method), it
> gets broken up into multiple glyphs.
>
> Here is a reproduction example. To execute these, you need to ensure proper
> unicode support on your terminal (I'm using foot).
>
> Executing the following properly prints a pirate flag emoji (🏴‍☠):
>
>     printf "\U1f3f4\u200d\u2620\n"
>
> But if I copy-paste that same glyph into my shell, I get:
>
>     🏴<200d>☠
>
> However, if I run `cat -`, and paste the same value, cat properly prints back
> the multi-codepoint glyph (the pirate flag in this case).
>
> This happens only for some distinct emoji. E.g.: "man shrugging": 🤷‍♂️.
>
> I have ruled out terminal support too (e.g.: as in the above example using
> `cat`). I also cannot reproduce the issue when using bash on the same setup.
>
> Have I stumbled upon a bug?

The COMBINING_CHARS option controls this behavior, eg you probably want to have
setopt COMBINING_CHARS
in your startup files.

-- 
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.