Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [BUG] ZLE character width with emoji presentation variation selectors in Unicode



On Fri, May 10, 2024 at 10:12 AM Advait Maybhate <advait@xxxxxxxx> wrote:
>
> In fish's case, I believe they use ridiculousfish/widecharwidth which does seem to handle emoji presentation selectors. unicode-width, part of the Rust stdlib, recently added support for correctly reporting the width of these sequences as well: unicode-width/pull/41.

Note that if your primary concern is emojis in prompts (rather than in
text typed as command input), zsh has the %G (for "glitch") prompt
sequence.  So if you write e.g.

PS1="Cloudy %{☁️%2G%}% "

then zsh will correctly reserve 2 positions for the glyph when
calculating the prompt. (Note gmail may have messed up the copy-paste
of the emoji; do it right and it works).




Messages sorted by: Reverse Date, Date, Thread, Author