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

Re: lining up RPS1 and PS1



In the last episode (Jun 06), Miek Gieben said:
> Hello,
> 
> I've been looking into the RPS1 variable to spice up my prompt.
> Currently my prompt looks like this: (it's a 2-line prompt)
> 
> [some info]
> %
> 
> Now I wanted to make it look like this:
> [some info]                  [some more]
> %
> (where RPS1="[some more]")
> 
> But as the PS1 includes a newline (to put the '%' on a seperate line)
> the prompt looks like:
> [some info]
> %                            [some more]
> 
> Is there any way to make a RPS1 line up with the first part of the PS1
> /and/ still have a newline in the PS1?

Simplest workaround would be to add escape codes to the start and end
of your RPROMPT that shifts the cursor up then back down:

RPROMPT="%{$termcap[up]%}Right Justified%{$termcap[do]%}"

Alternatively, take a look at the 'bart' prompt style, which is a
2-line prompt with right-aligned text on the top line.

-- 
	Dan Nelson
	dnelson@xxxxxxxxxxxxxxx



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