Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zero-width-joiner-joined emojis break everything #2541

Closed
kokolem opened this issue Apr 13, 2020 · 6 comments
Closed

Zero-width-joiner-joined emojis break everything #2541

kokolem opened this issue Apr 13, 2020 · 6 comments

Comments

@kokolem
Copy link

kokolem commented Apr 13, 2020

Hi,

there is a problem with zero-width-joiner-joined emojis in kitty, watch this:

Zero-width-joiner-joined emojis break kitty
Full quality video here.

Deleting part of an emoji made up of two emojis joined by a zero width joiner doesn't change the emoji displayed. For example, when pasting the Man Mechanic 👨‍🔧 (👨 U+1F468, Zero Width Joiner U+200D, 🔧 U+1F527) emoji into kitty, it correctly joins the characters into a single emoji followed by two invisible characters (the Zero Width Joiner U+200D and the Wrench emoji 🔧 U+1F527). However, after deleting the last character (🔧 U+1F527), kitty still displays the Man Mechanic, even though only 👨 U+1F468 and Zero Width Joiner U+200D should be displayed (they don't form any special emoji on their own). After pressing Return to get a new prompt and then pressing upwards arrow to use the previous command, kitty displays the emoji sequence differently (correctly) even though it's still the same sequence.

Pasting a more complicated zero-width-joiner-joined emoji into kitty breaks it even more. For example the Man Mechanic: Dark Skin Tone 👨🏿‍🔧 (👨 U+1F468, 🏿 U+1F3FF, Zero Width Joiner U+200D, 🔧 U+1F527) causes kitty to make the cursor jump over the character before the emoji and then makes deleting the PS1 prompt possible while duplicating the character after the emoji.

Configuration:
kitty: 0.17.2
kitty config: default
OS: Arch Linux
Kernel: 5.6.3
Shell: bash 5.0.16

@kovidgoyal
Copy link
Owner

dup of #1978

@kokolem
Copy link
Author

kokolem commented Apr 13, 2020

Hi,

I didn't find anyone mentioning ligatures not updating properly, cursor position problems, being able to delete the PS1 prompt, nor duplicating characters in #1978. Is this issue really a duplicate?

@kovidgoyal
Copy link
Owner

yeah it is. kitty has no support for ZWJ and frankly might never support
it as its a really bad idea that has serious performance implications to
support.

@trygveaa
Copy link
Sponsor Contributor

I can reproduce the issue of being able to delete PS1 with just 👨🏿, which doesn't have any ZWJ though (by moving the cursor before the emoji and pressing backspace).

But I guess that might be an issue with the shell, not with kitty, even though it happens in both bash and zsh? I don't know of any other terminal emulators that support skin tones, so I can't test if it also happens in other terminal emulators.

@kovidgoyal
Copy link
Owner

Try it with cat, this is almost certainly a shell issue

@trygveaa
Copy link
Sponsor Contributor

I can't test exactly the same with cat, since I did that by moving the cursor before the emoji. But I see that even if I don't move the cursor, two characters from PS1 can be deleted per emoji typed. I tried with echo -n test && cat, and yeah, test is never removed in that case.

@kokolem: You could try reporting the issue about deleting PS1 to bash or zsh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants