Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh themes problem



On Tue, 12 May 2009 20:25:20 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> However, in looking into this, I'm led to wonder about the *current*
> version of prompt_special_chars which seems to be assigning char[$code]
> where I suspect it should be assigning to schars[$code].
> 
> Can someone take a look?  PWS, you seem to have been responsible for
> the last ChangeLog entry on prompt_special_chars (25059 -- by the way,
> the CVS log says 25095, so one of those is a typo).
> 
> Also BTW, the test for UTF-8 in $LANG should probably also test for
> "utf8" per recent tweaks we had to make elsewhere, no?

I probably only tested it in en_GB.UTF-8.

Index: Functions/Prompts/prompt_special_chars
===================================================================
RCS file: /cvsroot/zsh/zsh/Functions/Prompts/prompt_special_chars,v
retrieving revision 1.2
diff -u -r1.2 prompt_special_chars
--- Functions/Prompts/prompt_special_chars	17 May 2008 22:42:17 -0000	1.2
+++ Functions/Prompts/prompt_special_chars	13 May 2009 08:32:22 -0000
@@ -8,7 +8,7 @@
 
 typeset -gA schars
 
-if [[ ${LC_ALL:-${LC_CTYPE:-$LANG}} = *UTF-8* ]]; then
+if [[ ${LC_ALL:-${LC_CTYPE:-$LANG}} = *(UTF-8|utf8)* ]]; then
   schars[300]=$'\xe2\x94\x94'
   schars[304]=$'\xe2\x94\x8c'
   schars[332]=$'\xe2\x94\x8c'
@@ -20,6 +20,6 @@
   schars[260]=$'\xe2\x96\x91'
 else
   for code in 300 304 332 333 371 372 262 261 260; do
-    eval "char[$code]=\$'\\$code'"
+    eval "schars[$code]=\$'\\$code'"
   done
 fi


-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070



Messages sorted by: Reverse Date, Date, Thread, Author