about summary refs log tree commit diff
path: root/Functions/Prompts/prompt_oliver_setup
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-11-18 15:15:27 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-11-18 15:15:27 +0000
commit17a3040fb730b71414f97d33474e995a3f80eb14 (patch)
tree252a8fa4b8f534e2c4031101924a36d7fa607573 /Functions/Prompts/prompt_oliver_setup
parent7d6621bcef33ec8c38fa5ebaff1d9201b18e8069 (diff)
downloadzsh-17a3040fb730b71414f97d33474e995a3f80eb14.tar.gz
zsh-17a3040fb730b71414f97d33474e995a3f80eb14.tar.xz
zsh-17a3040fb730b71414f97d33474e995a3f80eb14.zip
manual/8668
Diffstat (limited to 'Functions/Prompts/prompt_oliver_setup')
-rw-r--r--Functions/Prompts/prompt_oliver_setup12
1 files changed, 7 insertions, 5 deletions
diff --git a/Functions/Prompts/prompt_oliver_setup b/Functions/Prompts/prompt_oliver_setup
index 970991bed..a1bce3da2 100644
--- a/Functions/Prompts/prompt_oliver_setup
+++ b/Functions/Prompts/prompt_oliver_setup
@@ -1,24 +1,26 @@
 # oliver prompt theme
 
 prompt_oliver_help() {
-  cat - <<ENDHELP
+  cat <<'ENDHELP'
 With this prompt theme, the prompt contains the current directory,
-history number and the previous command\'s exit code (if non-zero)
+history number and the previous command's exit code (if non-zero)
 and a final character which depends on priviledges.
 
 The colour of the prompt depends on two associative arrays -
-\$pcolour and $\tcolour. Each array is indexed by the name of the
+$pcolour and $tcolour. Each array is indexed by the name of the
 local host. Alternatively, the colour can be set with parameters
 to prompt.
 
 The hostname and username are also included unless they are in the
-\$normal_hosts or \$normal_users array.
+$normal_hosts or $normal_users array.
 ENDHELP
 }
 
 prompt_oliver_setup() {
   prompt_opts=( percent )
-  
+
+  [[ "${(t)pcolour}" != assoc* ]] && typeset -Ag pcolour
+  [[ "${(t)tcolour}" != assoc* ]] && typeset -Ag tcolour
   local pcol=$'\e['${1:-${pcolour[${HOST:=`hostname`}]:-33}}m
   local tcol=$'\e['${2:-${tcolour[$HOST]:-37}}m
   local a host="%M:" user="%n "