zsh-users
 help / color / mirror / code / Atom feed
* Prompt for ZSH
@ 2007-05-25 12:20 Gerolf Ziegenhain
  2007-05-25 13:12 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Gerolf Ziegenhain @ 2007-05-25 12:20 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 556 bytes --]

Hi,

Recently I switched from bash to zsh. One thing that is _not_ working so far
is my old colored command prompt. I converted it to zsh and it looks like:

export PS1="$(print ${dark_gray})[$(print ${blue})%n$(print
${dark_gray})@$(print ${purple})%m$(print ${dark_gray})|$(print
${none})%1~$(print ${purple})>$(print ${none})"

But this command prompt has a problem with linebreak, as it is too long for
one line because of the escape sequences. In bash this issue could be solved
with something like

\[$COLOR\]

How to do this in zsh?

/BR:
   Gerolf

[-- Attachment #2: Type: text/html, Size: 627 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Prompt for ZSH
  2007-05-25 12:20 Prompt for ZSH Gerolf Ziegenhain
@ 2007-05-25 13:12 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2007-05-25 13:12 UTC (permalink / raw)
  To: zsh-users

"Gerolf Ziegenhain" wrote:
> But this command prompt has a problem with linebreak, as it is too long for
> one line because of the escape sequences. In bash this issue could be solved
> with something like
> 
> \[$COLOR\]
> 
> How to do this in zsh?

The equivalent is %{$COLOR%}.  See PROMPT EXPANSION in the zshmisc manual.

There are lots of examples of colours in prompts in zsh.  See the prompt
themes; these are documented in the zshcontrib manual.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php

To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-05-25 13:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-25 12:20 Prompt for ZSH Gerolf Ziegenhain
2007-05-25 13:12 ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).