From eff702f0a032ffc83e02cc00236f1918c7a69963 Mon Sep 17 00:00:00 2001 From: "U-PSI\\llanga" Date: Thu, 23 Sep 2010 17:45:48 +0200 Subject: [PATCH] portable PS1 colors support --- profile | 9 ++++++++- zshrc | 6 ++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/profile b/profile index 6ac0803..c54edf6 100644 --- a/profile +++ b/profile @@ -3,6 +3,14 @@ # for common variables look at profile_common. # +# +# the prompt +# +if [ -e ~/.pscolors ]; then + source ~/.pscolors +fi +export PS1="$PS_USERCOLOR\\u$PS_ATCOLOR@$PS_HOSTCOLOR\\H$PS_COLONCOLOR:$PS_PATHCOLOR\\w$PS_PROMPTCOLOR $ $PS_NOCOLOR" + # # my Bash modifications # @@ -13,7 +21,6 @@ bind -m vi-insert "\C-p":dynamic-complete-history bind -m vi-insert "\C-a":vi-append-eol export HISTCONTROL=erasedups export HISTSIZE=10000 -export PS1="\\u@\\H:\\w $ " set -o vi source ~/.profile_common diff --git a/zshrc b/zshrc index 793bdb0..fca9ef0 100644 --- a/zshrc +++ b/zshrc @@ -1,10 +1,12 @@ # Zsh-specific profile. For Bash specific look at profile, # for common variables look at profile_common. # - setopt allexport -PS1='%n@%m:%~ $ ' +if [ -e ~/.pscolors ]; then + source ~/.pscolors +fi +PS1="%{$PS_USERCOLOR%}%n%{$PS_ATCOLOR%}@%{$PS_HOSTCOLOR%}%m%{$PS_COLONCOLOR%}:%{$PS_PATHCOLOR%}%~%{$PS_PROMPTCOLOR%} $ %{$PS_NOCOLOR%}" HISTFILE=~/.zhistory HISTSIZE=10000 SAVEHIST=10000