[Pkg-zsh-devel] Bug#613162: zsh: Loading colors script fails, bad set of key/value pairs

Benjamin Peter benjaminpeter at arcor.de
Sun Feb 13 13:36:01 UTC 2011


Hi Frank,

thanks for your fast response!

On 02/13/2011 02:03 PM, Frank Terbeck wrote:
>> function, do this:
>>
>> % print ${(t)color}
>> % print ${#color}
>>
>> The first command should print `association', the second should print
>> an *even* number (`76' for me). Also, a trace might be helpful:
>>
>> % (set -x; colors;) 2>&1 | cat -v
>>      

(dedeibel at jet)(261/pts)(14:24:13.02.11)-
(%:~)- print ${(t)color}
association


(dedeibel at jet)(262/pts)(14:25:13.02.11)-
(%:~)- print ${#color}
4


(dedeibel at jet)(263/pts)(14:25:13.02.11)-
(%:~)- (set -x; colors;) 2>&1 | cat -v
+/bin/zsh:3> colors
+colors:4> typeset -Ag color colour
+colors:6> color=( 00 none 01 bold 02 faint 22 normal 03 standout 23 
no-standout 04 underline 24 no-underline 05 blink 25 no-blink 07 reverse 
27 no-reverse 08 conceal 28 no-conceal 30 black 40 bg-black 31 red 41 
bg-red 32 green 42 bg-green 33 yellow 43 bg-yellow 34 blue 44 bg-blue 35 
magenta 45 bg-magenta 36 cyan 46 bg-cyan 37 white 47 bg-white 39 default 
49 bg-default )
+colors:74> local k
+colors:75> k=bg-blue
+colors:75> color[${color[$k]}]=bg-blue
+colors:79> k=30
+colors:79> color[fg-${color[$k]}]=30
+colors:79> k=31
+colors:79> color[fg-${color[$k]}]=31
+colors:79> k=32
+colors:79> color[fg-${color[$k]}]=32
+colors:79> k=33
+colors:79> color[fg-${color[$k]}]=33
+colors:79> k=34
+colors:79> color[fg-${color[$k]}]=34
+colors:79> k=35
+colors:79> color[fg-${color[$k]}]=35
+colors:79> k=36
+colors:79> color[fg-${color[$k]}]=36
+colors:79> k=37
+colors:79> color[fg-${color[$k]}]=37
+colors:79> k=39
+colors:79> color[fg-${color[$k]}]=39
+colors:83> color[grey]=''
+colors:84> color[fg-grey]=''
+colors:85> color[bg-grey]=''
+colors:95> local 'lc=^[[' 'rc=m'
+colors:97> typeset -Hg reset_color bold_color
+colors:98> reset_color='^[[m'
+colors:99> bold_color='^[[m'
+colors:103> typeset -AHg fg fg_bold fg_no_bold
+colors:104> k=fg-red
+colors:105> fg[${k#fg-}]='^[[31m'
+colors:106> fg_bold[${k#fg-}]='^[[;31m'
+colors:107> fg_no_bold[${k#fg-}]='^[[;31m'
+colors:104> k=fg-black
+colors:105> fg[${k#fg-}]='^[[30m'
+colors:106> fg_bold[${k#fg-}]='^[[;30m'
+colors:107> fg_no_bold[${k#fg-}]='^[[;30m'
+colors:104> k=fg-green
+colors:105> fg[${k#fg-}]='^[[32m'
+colors:106> fg_bold[${k#fg-}]='^[[;32m'
+colors:107> fg_no_bold[${k#fg-}]='^[[;32m'
+colors:104> k=fg-default
+colors:105> fg[${k#fg-}]='^[[39m'
+colors:106> fg_bold[${k#fg-}]='^[[;39m'
+colors:107> fg_no_bold[${k#fg-}]='^[[;39m'
+colors:104> k=fg-magenta
+colors:105> fg[${k#fg-}]='^[[35m'
+colors:106> fg_bold[${k#fg-}]='^[[;35m'
+colors:107> fg_no_bold[${k#fg-}]='^[[;35m'
+colors:104> k=fg-yellow
+colors:105> fg[${k#fg-}]='^[[33m'
+colors:106> fg_bold[${k#fg-}]='^[[;33m'
+colors:107> fg_no_bold[${k#fg-}]='^[[;33m'
+colors:104> k=fg-white
+colors:105> fg[${k#fg-}]='^[[37m'
+colors:106> fg_bold[${k#fg-}]='^[[;37m'
+colors:107> fg_no_bold[${k#fg-}]='^[[;37m'
+colors:104> k=fg-blue
+colors:105> fg[${k#fg-}]='^[[34m'
+colors:106> fg_bold[${k#fg-}]='^[[;34m'
+colors:107> fg_no_bold[${k#fg-}]='^[[;34m'
+colors:104> k=fg-grey
+colors:105> fg[${k#fg-}]='^[[m'
+colors:106> fg_bold[${k#fg-}]='^[[;m'
+colors:107> fg_no_bold[${k#fg-}]='^[[;m'
+colors:104> k=fg-cyan
+colors:105> fg[${k#fg-}]='^[[36m'
+colors:106> fg_bold[${k#fg-}]='^[[;36m'
+colors:107> fg_no_bold[${k#fg-}]='^[[;36m'
+colors:112> typeset -AHg bg bg_bold bg_no_bold
+colors:113> k=bg-grey
+colors:114> bg[${k#bg-}]='^[[m'
+colors:115> bg_bold[${k#bg-}]='^[[;m'
+colors:116> bg_no_bold[${k#bg-}]='^[[;m'

Does this tell you anything?

What exactly does ${(kv)color} access? Is kv a value?


thanks,

Benjamin.







More information about the Pkg-zsh-devel mailing list