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

Re: Unicode ZWJ sequence



On 8/19/23, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Fri, Aug 18, 2023 at 8:24 AM Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>>
>> On 8/18/23, Alexandre ZANNI <alexandre@xxxxxxxxx> wrote:
>> >
>> > TL;DR: zsh is not handling Unicode ZWJ (Zero Width Joiner) sequence.
>> >
>> > "👩‍❤️‍👨" (that will probably not render here) is a Unicode grapheme
> [...]
>> > Is this problem already known?
>>
>> It's actually not possible to display these emojis in a terminal
>
> "Display" isn't quite the correct word here.  "Edit" rather.
>
> If you disable the "zle" option, you'll see the grapheme.

Well, I wasn't even really talking about zsh specifically, but I
suppose if you don't care where any text ends up on the screen then
yes, you can display them.

That said, if you want randomly corrupted listings you can setopt
combiningchars and zsh will output even ZWJ directly to the terminal.

(I have a vague memory I argued against this at some point in the past
since combining characters are deterministic but emojis are not, it
presumably never went anywhere though.

 It feels like the most correct thing to do is to not output ZWJ at
all when combiningchars is on, since then we know the terminal will
not combine emojis and we know where everything is. (Barring some
other mechanism for the terminal to give a wcwidth-like thing for
emoji combinations to the program running inside which seems on the
far end of the "not really worth it" scale.))

-- 
Mikael Magnusson




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