From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23679 invoked from network); 7 Feb 2005 01:14:39 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 7 Feb 2005 01:14:39 -0000 Received: (qmail 10589 invoked from network); 7 Feb 2005 01:14:33 -0000 Received: from unknown (HELO sunsite.dk) (130.225.247.90) by a.mx.sunsite.dk with SMTP; 7 Feb 2005 01:14:33 -0000 Received: (qmail 1204 invoked by alias); 6 Feb 2005 21:13:51 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8469 Received: (qmail 1189 invoked from network); 6 Feb 2005 21:13:51 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 6 Feb 2005 21:13:51 -0000 Received: (qmail 39693 invoked from network); 6 Feb 2005 21:13:14 -0000 Received: from rproxy.gmail.com (64.233.170.193) by a.mx.sunsite.dk with SMTP; 6 Feb 2005 21:13:11 -0000 Received: by rproxy.gmail.com with SMTP id a41so1112431rng for ; Sun, 06 Feb 2005 13:13:09 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding; b=g/1bBDooZPSDlLTvnWTjArq81oTY8ceg1g83DialX0iktoDS8k0799GqfqRseVI/Je7kQTo6YLkSCu2wv3R8oujS6i4+KplEeZ9aYJpFHEnLZnF1m2vSIDf1viv/YzULrQNUpCAADXlGvlSPJtX8Lz6DOeBlWQx/+OGBxMUCvjI= Received: by 10.38.9.30 with SMTP id 30mr192893rni; Sun, 06 Feb 2005 13:13:09 -0800 (PST) Received: by 10.38.72.43 with HTTP; Sun, 6 Feb 2005 13:13:09 -0800 (PST) Message-ID: <4fb292fa0502061313586f5465@mail.gmail.com> Date: Sun, 6 Feb 2005 22:13:09 +0100 From: beber mailing Reply-To: beber mailing To: zsh-users@sunsite.dk Subject: Misterous bug with %(# ... Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-1.9 required=6.0 tests=AWL,BAYES_00,RCVD_BY_IP autolearn=ham version=3.0.2 X-Spam-Hits: -1.9 Hello :) (first scuse for my poor english) Reading the zsh's man, I see a function that interest me a lot : %(x.true text.false text) I'm using it for jobs, and for $?. It's working very good. I wanted to change the prompt color if I'm logged as root. So I put this in my zshrc : host_color=%(#.magenta.green) And after I'm using the host_color for coloration (You can see the full zshrc at the end of mail) : host="%{$fg[$host_color]%}(%m)" warninfo="%{$fg[$host_color]%}^^ ROOT ^^ " But the color for $host is always black, I don't know why. When I do a echo $host, I have this : %(#.magenta.cyan) It seem to be good. Maybe somebody already have this error ? Thanks Beber The full zshrc : # /etc/zsh/zprofile # $Header: /var/cvsroot/gentoo-x86/app-shells/zsh/files/zprofile,v 1.1 2003/07/23 17:48:19 usata Exp $ [[ -e "/etc/profile.env" ]] && source /etc/profile.env #077 would be more secure, but 022 is generally quite realistic umask 022 if [[ "$USER" == root ]]; then export PATH="/bin:/sbin:/usr/bin:/usr/sbin:${ROOTPATH}:/${HOME}/bin:/usr/share/bin" else export PATH="/bin:/usr/bin:${PATH}:/${HOME}/bin:/usr/share/bin" fi unset ROOTPATH # Alias alias l="ls --color=auto" alias ls="ls --color=auto" alias la="ls --color=auto -a" alias lh="ls --color=auto -lh" alias ll="ls --color=auto -l" alias lha="ls --color=auto -lha" # List only file beginning with "." alias lsa="ls -ld .*" # List only directories and symbolic # links that point to directories alias lsd="ls -ld *(-/DN)" alias \.="pwd" alias \.\.="cd .." alias mp="mplayer" alias j="jobs" alias v="vim" # Global aliases -- These do not have to be # at the beginning of the command line. alias -g M='| more' alias -g H='| head' alias -g T='| tail' alias -g L='| less' alias -g C='| cat' # Alias selon compte case $USER in root) alias distccmon="DISTCC_DIR=/var/tmp/portage/.distcc distccmon-gnome" ;; beber) alias modprobe="sudo /sbin/modprobe" alias rmmod="sudo /sbin/rmmod" alias halt="sudo /sbin/halt" alias reboot="sudo /sbin/reboot" ;; *) alias mv="mv -i" ;; esac # Completion emerge autoload -U compinit promptinit compinit promptinit; # Colorisation du shell autoload -U colors colors host_color=%(#.magenta.green) echo $host_color path_color="cyan" date_color="blue" date_format="%d/%m %T" date="%{$fg[$date_color]%}%D{$date_format}" jobs="%1(j.%j .)" ret="%0(?..:( )" case $USER in root) #host_color="magenta" host="%{$fg[$host_color]%}(%m)" warninfo="%{$fg[$host_color]%}^^ ROOT ^^ " ;; *) host="%{$fg[$host_color]%}(%n@%m)" ;; esac cpath="%{$fg[$path_color]%}%~" end="%{$reset_color%}" PS1="$jobs$warninfo$cpath$end $ret%# " RPS1="$host $date$end" # Aide #unalias run-help #autoload run-help # Cache de completion zstyle ':completion::complete:*' use-cache 1 #zstyle ':completion::complete:*' cache-path ~/.zsh/cache/$HOST # history settings HISTFILE=~/.zshhistory HISTSIZE=3000 SAVEHIST=3000 # Bindkeys bindkey "^A" beginning-of-line bindkey "^E" end-of-line bindkey "^X" delete-char bindkey "^W" delete-word bindkey -v # vi key bindings bindkey "^V" vi-cmd-mode # Exports export VISUAL=/usr/bin/vim export EDITOR=/usr/bin/vim # Mail export MAIL=~/Maildir export MAILCHECK=60 # Afficher les nouvelles connections case $USER in root|beber) watch=( $(< /etc/passwd | cut -d ':' -f 1) ) #watch=(notme) # watch for everybody but me LOGCHECK=60 # check every 1 min for login/logout activity WATCHFMT='%n %a %l from %M at %T.' ;; esac # Options de correction setopt correct correctall #mailwarning