warpdotdev / Warp

Warp is a modern, Rust-based terminal with AI built in so you and your team can build great software, faster.
https://warp.dev
Other
21.53k stars 377 forks source link

Some of emojis are rendered correctly while typing but then incorrectly when displaying history. #1697

Open tnymlr opened 2 years ago

tnymlr commented 2 years ago

Discord username (optional)

No response

Describe the bug

Scottish flag emoji is displayed as black flag after executing a command.

You're doing the great job btw so far, in all other terminals I tried cursor jumps all over the place when you paste an emoji like that in the prompt, warp allows you to type it properly.

To Reproduce

Type

printf '🏴󠁧󠁢󠁳󠁣󠁴󠁿' | wc -m

Notice that the flag is rendered correctly. Press enter.

Expected behaviour

The terminal displays printf '🏴󠁧󠁢󠁳󠁣󠁴󠁿' | wc -m followed by number of bytes in the grapheme.

Screenshots

Screen Shot 2022-08-08 at 8 57 02 pm Screen Shot 2022-08-08 at 8 57 15 pm

Operating System

MacOS

OS Version

12.4

Shell Version

zsh 5.8.1 (x86_64-apple-darwin21.0)

Warp Version

v0.2022.08.01.09.12.stable_02

Additional context

No response

Does this block you from using Warp daily?

No

Warp Internal (ignore): linear-label:b8107fdf-ba31-488d-b103-d271c89cac3e

No response

tnymlr commented 2 years ago

Probably this will also help, this:

printf '👍🏾' | wc -m

is rendered as this in the history:

printf '👍 🏾' | wc -m but without the space, I had to remove the space so browser doesn't render the grapheme as single glyph.

elviskahoro commented 2 years ago

Thanks for the repro instructions. Will update you when we have some

connorjs commented 1 year ago
echo '->'

Using -> provides another example. I have changed the font to one that supports ligatures (should render roughly as →). When typing, I see the ligature (the real arrow). But on enter, the history shows the - and >.

It seems Warp DOES NOT render history with the chosen font. Why not?

When I copy/paste the history into my IDE (or other application), I see emojis and ligatures correctly again.

connorjs commented 1 year ago

For the Warp devs, to build on top of @tnymlr’s example, it seems to be an issue with any multi-code-point character.

echo '🌤 🏴󠁧󠁢󠁳󠁣󠁴󠁿'
Typed Rendered
typed rendered

You can see the code points on Emojipedia: Sun Behind Cloud (1 code point) and Flag for Scotland (7 code points).

The Flag for Scotland seems like a great test case given it represents a tag sequence.