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

Re: Tiny problem with a prompt



On 30 July 2011 15:47, Tomasz Moskal <ramshackle.industries@xxxxxxxxx> wrote:
> On Sat, 2011-07-30 at 15:00 +0200, Mikael Magnusson wrote:
>
>> You need to update PS1 inside precmd(), or use promptsubst and protect
>> the parameter expansion.
>
> Brilliant! Updating PS1 in precomd() did the trick. Would you mind
> explaining what did you mean by "protecting the parameter expansion" as
> the other solution?

Either by '$foo' or "\$foo" for example. Ie, put a literal $ sign in
the string. I would prefer updating PS1 in precmd() to setting
promptsubst though.


-- 
Mikael Magnusson



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