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

Re: positioning of RPS1



On 03/25/2018 10:36 AM, Ray Andrews wrote:
I think the trick was to put non-printing characters (like escape sequences) inside of "%{…}" sequences. That tells Zsh not to use characters in that sequence as printable characters when calculating the prompt width. I believe the same thing applies to both PROMPT and RPROMPT.

Thank you for the confirmation.

Thanks Grant, that's what I was hunting for: %{ ... %}. Interesting that it effects RPS1, I'd have thought that it sorta just attaches itself to the right margin and that the width of PS1 wouldn't matter to it that much, but I suppose that's naive, the entire prompt is worked out in one calculation.

You're welcome.  I'm glad that you got it working.

Depending on window width, prompt & command length, Zsh will remove the RPROMPT when the command gets too close. As such Zsh needs to know the printed width of the RPROMPT just like the (L)PROMPT.



--
Grant. . . .
unix || die

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature



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