zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Dan Neal <dan.r.neal@gmail.com>
Cc: zsh-workers@zsh.org
Subject: Re: Bug in RPROMPT alighnment
Date: Tue, 4 Oct 2022 10:32:49 +0200	[thread overview]
Message-ID: <CAHYJk3RO5mh8kPWUwn4cT_Sf0mcy0mvEOhxCukV_1eSD4QUmBw@mail.gmail.com> (raw)
In-Reply-To: <CAB2849toXc23ihzk=Fmx3ER==o5My7_Fu=ye0yMMhtWXbUN+Bw@mail.gmail.com>

On 10/4/22, Dan Neal <dan.r.neal@gmail.com> wrote:
> When a hyperlink is included in the RPROMPT, zsh mistakenly thinks the
> RPROMPT is longer than it actually is.  This results in the RPROMPT not
> being aligned all the way to the right but floats further to the middle.
>
> A minimal .zshrc demonstrating the bug:
> ```
> RPROMPT=$(eval "echo '\e]8;;http://example.com\aThis is a link\e]8;;\a'")
> ```
>
> The hyperlink specification is here:
> https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
>
> Please feel free to email me or cc me with any followup.

You need to use %{ and %} around non-printable escape sequences in your prompt.

-- 
Mikael Magnusson


  reply	other threads:[~2022-10-04  8:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-04  7:24 Dan Neal
2022-10-04  8:32 ` Mikael Magnusson [this message]
2022-10-04 19:40   ` Bart Schaefer

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=CAHYJk3RO5mh8kPWUwn4cT_Sf0mcy0mvEOhxCukV_1eSD4QUmBw@mail.gmail.com \
    --to=mikachu@gmail.com \
    --cc=dan.r.neal@gmail.com \
    --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).