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

Re: command substitution with control chars?



On 3/25/07, Atom Smasher wrote:
On Sun, 25 Mar 2007, Mikael Magnusson wrote:

> It sounds like you just need to put your escape sequences inside %{ %}
> pairs?
=====================

then i wind up getting colored "%{" and colored "%}" in the prompt, and
things are still hosed. maybe there's a way to do it, but i haven't
figured it out yet...

Seems to work for me...
The only change I made in the entire script was changing lines like
       echo -e "\033[01;34m$state\033[0m "
to
       echo -e "%{\033[01;34m%}$state%{\033[0m%} "

and then I did
       RPS1="[$(~/downloads/bat_mon.sh)]"

Which gave me
"downloads>                                                         [charged ]"
as my prompt, colored cyan, and tab completion worked fine.  There's
no need to do anything fancy, like port that script itself to zsh -
just adding %{ %} pairs around escape sequences in the echo -e command
ought to be enough.

~Matt



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