about summary refs log tree commit diff
path: root/Functions/Prompts/prompt_adam2_setup
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2007-06-14 16:10:50 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2007-06-14 16:10:50 +0000
commit88301c1c7389fc81683fbdd5168f8db82e46e66b (patch)
treeea957d75f9dbf67ff0e91502f0925f40124eb027 /Functions/Prompts/prompt_adam2_setup
parent2bd5223d5c091dce8f5048d1a49d11581cba8aa4 (diff)
downloadzsh-88301c1c7389fc81683fbdd5168f8db82e46e66b.tar.gz
zsh-88301c1c7389fc81683fbdd5168f8db82e46e66b.tar.xz
zsh-88301c1c7389fc81683fbdd5168f8db82e46e66b.zip
users/11568: use UTF-8 characters in some prompt themes
Diffstat (limited to 'Functions/Prompts/prompt_adam2_setup')
-rw-r--r--Functions/Prompts/prompt_adam2_setup19
1 files changed, 13 insertions, 6 deletions
diff --git a/Functions/Prompts/prompt_adam2_setup b/Functions/Prompts/prompt_adam2_setup
index e36b1475c..612cb8958 100644
--- a/Functions/Prompts/prompt_adam2_setup
+++ b/Functions/Prompts/prompt_adam2_setup
@@ -10,8 +10,8 @@ where the colors are for the hyphens, current directory, user@host,
 and user input bits respectively.  The default colors are cyan, green,
 cyan, and white.  This theme works best with a dark background.
 
-If you have the `nexus' or `vga' console fonts or similar, you
-can specify the `8bit' option to use 8-bit replacements for the
+If you have either UTF-8 or the `nexus' or `vga' console fonts or similar,
+you can specify the `8bit' option to use 8-bit replacements for the
 7-bit characters.
 
 And you probably thought adam1 was overkill ...
@@ -24,10 +24,17 @@ prompt_adam2_setup () {
 
   if [[ $1 == '8bit' ]]; then
     shift
-    prompt_gfx_tlc=$'\xda'
-    prompt_gfx_mlc=$'\xc3'
-    prompt_gfx_blc=$'\xc0'
-    prompt_gfx_hyphen=$'\xc4'
+    if [[ ${LC_ALL:-${LC_CTYPE:-$LANG}} = *UTF-8* ]]; then
+      prompt_gfx_tlc=$'\xe2\x94\x8c'
+      prompt_gfx_mlc=$'\xe2\x94\x9c'
+      prompt_gfx_blc=$'\xe2\x94\x94'
+      prompt_gfx_hyphen=$'\xe2\x94\x80'
+    else
+      prompt_gfx_tlc=$'\xda'
+      prompt_gfx_mlc=$'\xc3'
+      prompt_gfx_blc=$'\xc0'
+      prompt_gfx_hyphen=$'\xc4'
+    fi
   else
     prompt_gfx_tlc='.'
     prompt_gfx_mlc='|'