You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been looking at lib/spectrum.zsh since I've been working on prompt color stuff lately.
Does the spectrum_ls() function work? It says it displays all 256 colors, but when I run it, only the first 8 or so lines are colored, and the rest are in the default color. This happens on OS X 10.9, Windows 7, and Debian 7.
Here's the implementation.
# Show all 256 colors with color numberfunctionspectrum_ls() {
forcodein {000..255};do
print -P -- "$code: %F{$code}$ZSH_SPECTRUM_TEXT%f"done
}
Instead of using the ${FG[n]} control sequences it defined itself, it's using zsh's %F...%f prompt color controls. I don't think those support 256-color numeric codes; only the basic ANSI colors.
If I rewrite it using the control sequences instead of prompt color controls, then all 256 colors are shown as being colored.
# Show all 256 colors with color numberfunctionspectrum_ls2() {
forcodein {000..255};do
print -P "$code: ${FG[$code]}$ZSH_SPECTRUM_TEXT${FX[reset]}"done
}
Am I missing something here?
The text was updated successfully, but these errors were encountered:
Turns out this was due to user error. I had my terminal misconfigured. $TERM was set to xterm instead of xterm-256color. Switching it to xterm-256color made the current implementation of spectrum_ls work.
I couldn't find anywhere in the Zsh reference manual that discusses 256 color support, and the doco for %F/%f talks about following it with a single ASCII digit. But maybe the documentation is just out of date.
I've been looking at
lib/spectrum.zsh
since I've been working on prompt color stuff lately.Does the
spectrum_ls()
function work? It says it displays all 256 colors, but when I run it, only the first 8 or so lines are colored, and the rest are in the default color. This happens on OS X 10.9, Windows 7, and Debian 7.Here's the implementation.
Instead of using the
${FG[n]}
control sequences it defined itself, it's using zsh's%F...%f
prompt color controls. I don't think those support 256-color numeric codes; only the basic ANSI colors.If I rewrite it using the control sequences instead of prompt color controls, then all 256 colors are shown as being colored.
Am I missing something here?
The text was updated successfully, but these errors were encountered: