Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: prompt color pbg ,pfg,pbg_bold,pfg_bold in colors function?
- X-seq: zsh-workers 22620
- From: Frank Terbeck <frank.terbeck@xxxxxxxxxxxxxx>
- To: Zsh-Workers <zsh-workers@xxxxxxxxxx>
- Subject: Re: prompt color pbg ,pfg,pbg_bold,pfg_bold in colors function?
- Date: Fri, 18 Aug 2006 15:08:50 +0200
- In-reply-to: <20060818102602.GA24702@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: Zsh-Workers <zsh-workers@xxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- Operating-system: Linux 2.6.16.16 i686
- References: <20060818102602.GA24702@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Matthias Kopfermann <matthi@xxxxxxxxxxxxxxxxx>:
> The fg, fg_bold associative array and bg and bg_bold in the
> colors function are quite useful.
>
> For _prompts_ i have to surround every variable with %{ %} which
> does not , aehem, look too nice.
> what do you think? would it be fine to have that with
> wrapped around %{ %} , too so that not everybody has to put
> these around the keys or roll a prompt_colors_array on his
> own?
>
> I think, i would love to be able to just use
> PS1=$pbg[red]%~ ...
> and it just works out of the box in every zsh.
>
> Bad idea?
Not at all, IMHO.
I just think that the colors function would load quite a lot of
redundant information, if these are added as well. Maybe these
definitions could be added by a new function (e.g. prompt_colors).
Of course you could add code like:
[snip]
for i in ${(k)fg} ; do pfg[$i]="%{$fg[$i]%}" ; done
[snap]
to your .zshrc, but I guess a loadable function would be easier for
new users.
As an addition:
Today a user asked on IRC how to print out blinking text with the help
of the autoloadable colors function. I told him that, this would do:
[snip]
blink="\e[${color[blink]}m"
[snap]
Maybe it would be helpful to add this to the colors function:
[snip]
blink_color="$lc${color[blink]}$rc"
[snap]
Regards, Frank
Messages sorted by:
Reverse Date,
Date,
Thread,
Author