zsh-users
 help / color / mirror / code / Atom feed
* Colored PS1
@ 2005-09-07  3:25 Meino Christian Cramer
  2005-09-07  7:53 ` Tim Kruse
  0 siblings, 1 reply; 9+ messages in thread
From: Meino Christian Cramer @ 2005-09-07  3:25 UTC (permalink / raw)
  To: zsh-users

Hi,

 from the german version of the zsh-lovers page I got the following
 hint to colorise the prompt of the shell:

     autoload -U colors && colors
     echo "$fg_bold[red]zsh $fg_no_bold[white]is $bg[blue]$fg_bold[green]nice"

 which prints a colored string. So far so nice.

 Now I thought my previous PS1-string

     export PS1="%B%(?..[%?] )%b%n@%U%m%u:%1~>"

 would be nicer if I would change it to:

     export PS1="%B%(?..[%?] )$fg_bold[red]%b$fg_no_bold[black]%n@%U%m%u:%1~>"

 but this does not work for me. The prompt remains the same but
 expansion/expanding on the commandline gets a hickup. My TERM is set
 to "xterm" and normally colored output is no problem.

 What is wrong in my assumption, that first the $fg_bold[red] and
 $fg_no_bold[black] get expanded to their "real" escape sequences and
 then and thing like %b get replaced by their current value and then
 the string is sent to the terminal which finally colors the output
 accordingly? 

 If I do a 

     echo $PS1"

 I get a correctly colored output (the special expanding of for
 example %b is missing then, which is ok).

 Hmmm....?

 Thank you very much for any help in advance !

 Have a nice week!
 Meino


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

end of thread, other threads:[~2005-09-09 14:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-07  3:25 Colored PS1 Meino Christian Cramer
2005-09-07  7:53 ` Tim Kruse
2005-09-07 14:57   ` Bart Schaefer
2005-09-07 17:21   ` Meino Christian Cramer
2005-09-08  2:39     ` Bart Schaefer
2005-09-08  3:31       ` Meino Christian Cramer
2005-09-08 16:05         ` Bart Schaefer
2005-09-08 16:59           ` Meino Christian Cramer
2005-09-09 14:32             ` Bart Schaefer

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).