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
20.26k stars 337 forks source link

Prompt input does not handle emoji grapheme clusters #4191

Open paperdave opened 4 months ago

paperdave commented 4 months ago

Discord username (optional)

paperdave.net

Describe the bug

warp's input buffer is unusable when using certain multi-codepoint emojis. i dont seem to reproduce this for all grapheme cluster types, just emojis.

To reproduce

Expected behavior

i would like to see one grapheme, similar to other terminals

image

but ideally, the cursor is actually sticks at the end of the single grapheme, since this is a GUI app with a gui text input; this prompt does not need to abide by wcrules.

support for proper grapheme cluster support is opened in #4190, which covers this more broadly.

Screenshots

(this is 🏳️‍⚧️)

image

Operating system

MacOS

Operating system and version

MacOS 13.6

Shell Version

fish, version 3.6.1

Current Warp version

v0.2024.02.13.08.02.stable_00

Regression

No, this bug or issue has existed throughout my experience using Warp

Recent working Warp date

No response

Additional context

This seems distinct from #1995 as this issue is looking at prompt and not the output. when used in a non-warpify shell, this emoji kind of renders differently

image

i think resolving this is covered by that issue or a new issue.

Does this block you from using Warp daily?

No

Is this a Warp specific issue? (i.e. does it happen in Terminal, iTerm, Kitty, etc.)

Yes, this I confirmed this only happens in Warp, not other terminals.

Warp Internal (ignore): linear-label:b9d78064-c89e-4973-b153-5178a31ee54e

None

dannyneira commented 4 months ago

Hey @paperdave what font are you using? I recommend nerd fonts which contain a lot more characters. I also recommend a custom prompt like p10k which will help with displaying characters correctly in the setup.

Prompt Docs: https://docs.warp.dev/appearance/prompt#custom-prompt-compatibility-table P10k setup: https://www.youtube.com/watch?v=dIV9Cso4Mi8

paperdave commented 4 months ago
image

I am using the default configuration. This should not require additional setup, nerd fonts, or anything else.

Furthermore, this happens on every font I tried, including my main one 'Rec Mono Duotone' which is the font I usually use. Note that all other terminals handle this in either two ways

Advait-M commented 1 week ago

Heyo! We now support Emoji Presentation Selectors from Unicode in Warp 😄 i.e. stuff like ❤️ and ☁️ should be correctly rendered! We implemented this as a part of #2304 (for better Starship prompt support in fish with chips such as gcloud).

Note that there's a bug with Zsh that results in slight spacing issues (not the case in bash/fish) - see https://www.zsh.org/mla/workers/2024/msg00481.html for some discussion on that front.

Though, there's additional Unicode specifications we need to support in order to support some of the other emoji mentioned here e.g. 🏳️‍⚧️

As such, I'm going to leave this issue open for now, until we get around to better support for those!

paperdave commented 1 week ago

this is definetly an improvement. but either Warp stable does not have the changes for emoji presentation selectors, or it does not fully work (macOS 14).

notice how ❤️ is rendered as ❤. you can backspace the variation selector separately from the entire unit. the same applies to ☁️.

❤️‍🔥 and 🏳️‍⚧️ is rendered OK with the zero with joiner being invisible and both. this is a huge improvement over the garbled text originally.

image
Advait-M commented 1 week ago

Ah, to clarify @paperdave: this is in finished blocks! Fixing emoji presentation selector support in the input editor is a known issue and we'll prioritize this later (no concrete ETA here unfortunately)

image

Advait-M commented 1 week ago

(in addition to more broadly supporting grapheme clusters throughout both later!)