zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Alexandre ZANNI <alexandre@acceis.fr>
Cc: zsh-workers@zsh.org
Subject: Re: Unicode ZWJ sequence
Date: Fri, 18 Aug 2023 17:24:45 +0200	[thread overview]
Message-ID: <CAHYJk3Rh08Jw0KR==N6ibgZ3XeTx-6LqL2dG_G3hfBCYaWGLaQ@mail.gmail.com> (raw)
In-Reply-To: <3777545.kQq0lBPeGt@norarch>

On 8/18/23, Alexandre ZANNI <alexandre@acceis.fr> wrote:
> Hi,
>
> I'm new to this newsletter, I don't know if I'm reporting this issue
> correctly. All I found is this email address.
>
> TL;DR: zsh is not handling Unicode ZWJ (Zero Width Joiner) sequence.
>
> "👩‍❤️‍👨" (that will probably not render here) is a Unicode grapheme
> composed of multiple code points (U+1f469 U+200d U+2764 U+fe0f U+200d
> U+1f468). It's basically combining some emojis together to craft a more
> complex one. For that the Zero Width Joiner ‍(U+200D) and the Variation
> Selector-16 (U+FE0F) are used. But instead of displaying one grapheme, zsh
> is displaying each individual code point.
> As you can see below the terminal emulator named foot is capable of
> displaying such a grapheme, and other command line shell like bash or fish
> are capable of it too, only zsh can't.
>
> [1]
> Using zsh 5.9.
>
> Is this problem already known?

It's actually not possible to display these emojis in a terminal
correctly. There is no way for the program inside the terminal (zsh)
to know whether the rendering application will combine emojis with a
ZWJ between them, and thus has no idea what width they will take up.
This makes it impossible to predict where linebreaks will happen, etc,
leading to display corruption unless you happen to guess correctly.

-- 
Mikael Magnusson


  reply	other threads:[~2023-08-18 15:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-18 13:02 Alexandre ZANNI
2023-08-18 15:24 ` Mikael Magnusson [this message]
2023-08-19 16:16   ` Bart Schaefer
2023-08-19 16:46     ` Mikael Magnusson
2023-08-19 17:07       ` Bart Schaefer
2023-08-19 17:11         ` Bart Schaefer
2023-08-19 15:53 ` Roman Perepelitsa
2023-08-19 17:11   ` Wesley Schwengle
2023-08-20  0:06     ` maxbeckie
2023-08-20  0:13       ` Lawrence Velázquez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHYJk3Rh08Jw0KR==N6ibgZ3XeTx-6LqL2dG_G3hfBCYaWGLaQ@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=alexandre@acceis.fr \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).