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

Re: Pasting multi-codepoint glyph breaks it into two



On Thu, Feb 27, 2025 at 1:30 PM Hugo Osvaldo Barrera <hugo@xxxxxxxxxxxxx> 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




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