From 88301c1c7389fc81683fbdd5168f8db82e46e66b Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 14 Jun 2007 16:10:50 +0000 Subject: users/11568: use UTF-8 characters in some prompt themes --- Functions/Prompts/prompt_adam2_setup | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'Functions/Prompts/prompt_adam2_setup') 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='|' -- cgit 1.4.1