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

Re: Bug in RPROMPT alighnment



On 10/4/22, Dan Neal <dan.r.neal@xxxxxxxxx> 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




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