microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.31k stars 8.29k forks source link

ZWJ Emoji (like "Ninja Cat") cannot be used in Icon field #8583

Open jrabbit opened 3 years ago

jrabbit commented 3 years ago

I can't set my icon to 🐱‍💻 but 🤖 works as expected. in terminal-preview.

Environment

Windows build number: [run `[Environment]::OSVersion` for powershell, or `ver` for cmd]
Windows Terminal version (if applicable):
 Win32NT             10.0.19042.0 Microsoft Windows NT 10.0.19042.0
Any other software?

Steps to reproduce

Set Icon property to a fancy zwj emoji.

Expected behavior

Icon should be the emoji.

Actual behavior

json doesn't validate

skyline75489 commented 3 years ago

Yeah you're right. Right now the restriction for emoji strings are very strict. See:

https://github.com/microsoft/terminal/blob/b80a4e45cce0a9cb47e5bb1ad51f86eb84e59471/src/cascadia/TerminalSettingsModel/IconPathConverter.cpp#L114

We need a better way to detect complicated emojis.

zadjii-msft commented 3 years ago

Yep that's a good point. I wonder if ZWJ emoji will actually work as a FonIcon 😬

Oh, no they won't image

So we'll need to file this upstream on WinUI

EDIT: NEVERMIND I'M DAFT.

<muxc:FontIconSource FontFamily="Segoe UI"  Glyph="🐱‍💻" />

image

The icon doesn't use font fallback, it needs to be told FontFamily="Segoe UI" explicitly.

skyline75489 commented 3 years ago

So ZWJ emojis can be very long and take up to about 8 wchars, according to emoji-zwj-sequences. Guess length check isn't going to suffice. I wonder if this can be an early adopter of the Unicode handling work by @reli-msft .

fitojb commented 2 years ago

The Windows 11 emoji set no longer supports the ninja cat sequences, so this issue may be considered moot now

DHowett commented 2 years ago

Nah, we should still make sure we support these. Important emoji like "Woman whose skin is not yellow" are ZWJ-joined as well. :smile: