summaryrefslogtreecommitdiff
path: root/11_Colors.zsh
diff options
context:
space:
mode:
authorHugues Hiegel <hugues@hiegel.fr>2009-02-05 15:39:26 +0100
committerHugues Hiegel <hugues@hiegel.fr>2009-02-05 15:39:26 +0100
commit27582116d6ffe087da0844fd5b67b513bfcb2b09 (patch)
tree5522a9c43d7fcf6fdc9046c81a603d672ae28635 /11_Colors.zsh
parenta5efacfc5a6a602ea5a0f67df2883da713e9fc2a (diff)
[Colors] better managment of colors...
Diffstat (limited to '11_Colors.zsh')
-rw-r--r--11_Colors.zsh30
1 files changed, 17 insertions, 13 deletions
diff --git a/11_Colors.zsh b/11_Colors.zsh
index 00d405d..3debc13 100644
--- a/11_Colors.zsh
+++ b/11_Colors.zsh
@@ -26,19 +26,6 @@ PS1_ROOT=${PS1_ROOT:-$color[red]}
PS1_USER=${PS1_USER:-$color[blue]}
PS1_USER_SSH=${PS1_USER_SSH:-$color[magenta]}
PS1_USER_SCR=${PS1_USER_SCR:-$color[cyan]}
-prompt_colors[generic]=`print -Pn "%(! $PS1_ROOT $PS1_USER)"`
-
-normal_user && if ( [ "$SSH_TTY" != "" ] )
-then
- # This allows us to easily distinguish shells
- # which really are on the local machine or not.
- # That's so good, use it ! :-)
- prompt_colors[generic]=${PS1_USER_SSH:-$prompt_colors[generic]}
-fi
-normal_user && if ( [ "$TERM" = "screen" ] )
-then
- prompt_colors[generic]=${PS1_USER_SCR:-$prompt_colors[generic]}
-fi
#
# This func is intended to give a quick way to set the colors for the
@@ -46,6 +33,23 @@ fi
#
set_prompt_colors ()
{
+ prompt_colors[generic]=`print -Pn "%(! $PS1_ROOT $PS1_USER)"`
+
+ if normal_user
+ then
+ if ( [ "$SSH_TTY" != "" ] )
+ then
+ # This allows us to easily distinguish shells
+ # which really are on the local machine or not.
+ # That's so good, use it ! :-)
+ prompt_colors[generic]=${PS1_USER_SSH:-$prompt_colors[generic]}
+ fi
+ if ( [ "$TERM" = "screen" ] )
+ then
+ prompt_colors[generic]=${PS1_USER_SCR:-$prompt_colors[generic]}
+ fi
+ fi
+
local my_generic
my_generic=${1:-$prompt_colors[generic]}
prompt_colors[bold_generic]="$my_generic;$color[bold]" ## Always bold generic color