From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23262 invoked by alias); 24 Mar 2013 21:48:39 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 31178 Received: (qmail 19392 invoked from network); 24 Mar 2013 21:48:37 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_NONE,RCVD_NUMERIC_HELO, SPF_HELO_PASS,T_TO_NO_BRKTS_FREEMAIL autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at m.gmane.org designates 80.91.229.3 as permitted sender) X-Injected-Via-Gmane: http://gmane.org/ To: zsh-workers@zsh.org From: Christian Neukirchen Subject: Re: Outputting colored zsh prompts from an external script Date: Sun, 24 Mar 2013 22:30:10 +0100 Sender: chris@juno Message-ID: <87620g32ql.fsf@gmail.com> References: <20130324192345.GA20437__22562.4022576541$1364153239$gmane$org@kaeru> Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 141.84.9.5 In-Reply-To: <20130324192345.GA20437__22562.4022576541$1364153239$gmane$org@kaeru> (seanh's message of "Sun, 24 Mar 2013 20:23:45 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) seanh 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 http://chneukirchen.org