zsh-workers
 help / color / mirror / code / Atom feed
From: Advait Maybhate <advait@warp.dev>
To: Bart Schaefer <schaefer@brasslantern.com>
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: Mon, 13 May 2024 20:04:02 -0400	[thread overview]
Message-ID: <CAN+tYMfXYrHtVFydiaFO9LqmbkyL0n8rs-29kqqADEes0a_39g@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7bEf6f+RB_GpYc04asW-Lf8WD+5z3W1Pt-fmZJMqexdUw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1204 bytes --]

Ah cool - didn't know about the glitch prompt. Thanks for the info!

Hmm, though yep, I was observing that the width reservation seems to be
working correctly in the prompt itself but seems to fail for the bracketed
paste case (when testing in Kitty for correctness), thus the glitch prompt
doesn't entirely help here unfortunately.



On Fri, May 10, 2024 at 4:40 PM Bart Schaefer <schaefer@brasslantern.com>
wrote:

> 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).
>

[-- Attachment #2: Type: text/html, Size: 1645 bytes --]

      reply	other threads:[~2024-05-14  0:04 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
2024-05-14  0:04         ` Advait Maybhate [this message]

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=CAN+tYMfXYrHtVFydiaFO9LqmbkyL0n8rs-29kqqADEes0a_39g@mail.gmail.com \
    --to=advait@warp.dev \
    --cc=aloke@warp.dev \
    --cc=schaefer@brasslantern.com \
    --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).