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

Re: psvar expansion with %v



On Jul 26,  9:33am, DervishD wrote:
}
} >     How can I use psvar and %v to get a readable PS1 *but* use escape
} > sequences at the same time? I'm using zsh 4.2.5 (i686-pc-linux-gnu)
} 
}     I still haven't solved this, and I've carried a lot of tests. Is
} any way of using '%{%}' constructs, or escape sequences, using psvar?

No, there isn't.  The results of percent-expandos are not re-expanded,
so whatever gets inserted by %v appears literally in the final prompt.
Furthermore, anything inserted by any percent-expando (be it your user
name, or the host name, or the contents of psvar) is deliberately put
through a conversion to printable form so that you can't accidentally
mess up ZLE by moving the cursor or emitting something whose displayed
length cannot be accurately counted.

Consider the bad things that could otherwise result if you created a
directory with strange characters in its name when your prompt has %/
in it, or had such a directory in your path when using %N.



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