Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: lining up RPS1 and PS1
- X-seq: zsh-users 8958
- From: Dan Nelson <dnelson@xxxxxxxxxxxxxxx>
- To: zsh users <zsh-users@xxxxxxxxxx>
- Subject: Re: lining up RPS1 and PS1
- Date: Mon, 6 Jun 2005 10:04:09 -0500
- In-reply-to: <20050606101820.GC26977@xxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20050606101820.GC26977@xxxxxxxxx>
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