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

Re: Unicode ZWJ sequence



On Sat, Aug 19, 2023 at 9:46 AM Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>
> 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.

In this case he's got a terminal emulator that is able to display the
grapheme, and in fact as the output of "echo" it works fine, it's only
on the command line that zsh is behaving differently -- and that's
because zle understands the potential problems you described and does
what it can to avoid them.

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

It doesn't, though -- even with combiningchars you don't get the
joins, you just get the red heart:

% echo "👩<200d>❤<fe0f><200d>👨"
👩‍❤️‍👨
% setopt combiningchars
% echo "👩<200d>❤️<200d>👨"
👩‍❤️‍👨
%

> (I have a vague memory I argued against this at some point in the past

I think you may have prevailed.

I any event we're not talking about output in the stdout sense here,
we're talking about what zle has in the editor buffer after it gets
terminal input.




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