xtermjs / xterm.js

A terminal for the web
https://xtermjs.org/
MIT License
17.32k stars 1.61k forks source link

Support emojis with skin tone #3397

Open Tyriar opened 3 years ago

Tyriar commented 3 years ago

From @pcgeek86 in https://github.com/microsoft/vscode/issues/129470

Does this issue occur when all extensions are disabled?: Yes

Steps to Reproduce:

  1. Run Python 3 in VSCode Integrated Terminal
  2. Paste code below
mystr = ''
for x in [0x1F442, 0x1F3FC]:
  mystr += str(chr(x))

print(mystr)
print('๐Ÿ‘Œ๐Ÿป')

Here's how VSCode Integrated Terminal renders it:

image

Here's what it (correctly) looks like in Microsoft Terminal (albeit it has a whitespace issue):

image

Expected Result

Emojis with skin tones should be rendered with the specified string.

Actual Result

Emojis with skin tones are rendered as two separate characters.

PerBothner commented 2 years ago

This is related to handling of Extended Grapheme Clusters. See this comment about how Domterm handles clusters.

starball5 commented 9 months ago

Does this issue ticket cover other similar issues like https://stackoverflow.com/q/77425006/11107541 or should a new issue ticket be raised for that?

PerBothner commented 9 months ago

I believe this can be closed, now that PR #4519 has been merged.

You need to enable the unicode-graphemes addon.

starball5 commented 9 months ago

@Tyriar Does VS Code yet have an issue ticket about enabling the unicode-graphemes addon? If you create one / know of one, can you please ping me with it?