From: beber mailing <beber.mailing@gmail.com>
To: zsh-users@sunsite.dk
Subject: Misterous bug with %(# ...
Date: Sun, 6 Feb 2005 22:13:09 +0100 [thread overview]
Message-ID: <4fb292fa0502061313586f5465@mail.gmail.com> (raw)
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
next reply other threads:[~2005-02-07 1:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-06 21:13 beber mailing [this message]
2005-02-07 5:04 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4fb292fa0502061313586f5465@mail.gmail.com \
--to=beber.mailing@gmail.com \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).