zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Advait Maybhate <advait@warp.dev>
Cc: zsh-workers@zsh.org, Aloke Desai <aloke@warp.dev>,
	Zach Bai <zachbai@warp.dev>
Subject: Re: [BUG] ZLE character width with emoji presentation variation selectors in Unicode
Date: Fri, 10 May 2024 13:40:08 -0700	[thread overview]
Message-ID: <CAH+w=7bEf6f+RB_GpYc04asW-Lf8WD+5z3W1Pt-fmZJMqexdUw@mail.gmail.com> (raw)
In-Reply-To: <CAN+tYMcLu5kCRM1cN1tV4O65ALBkFQd44WtrQH7Ly6QsKgTxAg@mail.gmail.com>

On Fri, May 10, 2024 at 10:12 AM Advait Maybhate <advait@warp.dev> 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).


  parent reply	other threads:[~2024-05-10 20:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-09 14:45 Advait Maybhate
2024-05-10  9:37 ` Mikael Magnusson
2024-05-10  9:54   ` Mikael Magnusson
2024-05-10 17:11     ` Advait Maybhate
2024-05-10 18:57       ` Mikael Magnusson
2024-05-14  0:08         ` Advait Maybhate
2024-05-10 20:40       ` Bart Schaefer [this message]
2024-05-14  0:04         ` Advait Maybhate

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7bEf6f+RB_GpYc04asW-Lf8WD+5z3W1Pt-fmZJMqexdUw@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=advait@warp.dev \
    --cc=aloke@warp.dev \
    --cc=zachbai@warp.dev \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).