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

Re: Length of %? in prompt



On Tue, Feb 26, 2002 at 05:10:45PM +0000, Bart Schaefer wrote:
> On Feb 26,  4:05pm, Ian Lynagh wrote:
> }
> } If the length of %? will alter the number of dashes following it in my
> } prompt am I right in thinking that my only course of action is to
> } enumerate the (rather large!) set of possible cases with
> } "%(n?,---...,)"? If so I guess I will have to redesign  :-(
> 
> No, you don't need to do that.  You can use the truncation sequences %>>
> and/or %<<.  Let's assume that you want the value of %? plus the hyphens
> to take up a total of 10 characters; you'd use:
> 
>     %10>-->%?--------%<<

Oh, of course! In fact, if I am lucky this will make the whole thing a
bit simpler.

I don't understand this 0 case though - is it a bug?

ian@majestica:~% export PS1="%10>-->0--------%<< " 
0-------- export PS1="%10>-->10--------%<< " 
10-------- export PS1="%10>-->100--------%<< "
100------- export PS1="%10>-->1000--------%<< "
1000------ echo $ZSH_VERSION
4.0.4


Thanks
Ian



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