Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Outputting colored zsh prompts from an external script
- X-seq: zsh-workers 31178
- From: Christian Neukirchen <chneukirchen@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Outputting colored zsh prompts from an external script
- Date: Sun, 24 Mar 2013 22:30:10 +0100
- In-reply-to: <20130324192345.GA20437__22562.4022576541$1364153239$gmane$org@kaeru> (seanh's message of "Sun, 24 Mar 2013 20:23:45 +0100")
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20130324192345.GA20437__22562.4022576541$1364153239$gmane$org@kaeru>
- Sender: chris@juno
seanh <snhmnd@xxxxxxxxx> writes:
> I also tried getting zshprompt.py to print out zsh color codes like
> %{$fg[red]%}FOO%{$reset_color%}, but zsh doesn't seem to interpret these
> when they're printed by zshprompt.py, it just prints them out into the
> prompts literally. I tried various zsh options with this, such as
> setopt promptpercent and setopt promptsubst, and tried various other ways of
> calling the Python script, such as within double-quotes or back-ticks
> instead of single-quotes, or without any quotes at all. Nothing worked.
This works here (note how it gets executed every time):
setopt promptsubst
PROMPT+='$(date +"%%F{red}%H:%M:%S%%f") '
Alternatively, you could try setting the prompt in a precmd().
But I expect terrible performance from running a python command before
every prompt. It does not seem very hard to port that python code there
to plain zsh.
Have fun,
--
Christian Neukirchen <chneukirchen@xxxxxxxxx> http://chneukirchen.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author