zsh-workers
 help / color / mirror / code / Atom feed
* [bug] color none vs. default
@ 2006-10-08 21:27 denis
  0 siblings, 0 replies; 3+ messages in thread
From: denis @ 2006-10-08 21:27 UTC (permalink / raw)
  To: zsh-workers

Hi,

according to the manpage (zshcontrib) you could reset all
attributes using the color 'none', but this doesn't work.

    autoload -U colors
    colors
    echo "$fg[red]this is red$fg[none]this is still red"

Instead you have to use $fg[default] (thanks to #zsh on freenode).


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [bug] color none vs. default
  2006-10-08 22:22 ` Bart Schaefer
@ 2006-10-08 23:37   ` denis
  0 siblings, 0 replies; 3+ messages in thread
From: denis @ 2006-10-08 23:37 UTC (permalink / raw)
  To: zsh-workers

Bart Schaefer wrote:
> On Oct 8, 11:27pm, denis wrote:
> }
> } according to the manpage (zshcontrib) you could reset all
> } attributes using the color 'none', but this doesn't work.
> 
> You're misreading the documentation.

oh, then sorry for the "[bug]" in the subject :)

Thank you for the explanation.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [bug] color none vs. default
       [not found] <200610082129.k98LTxIq003101@torgo.zanshin.com>
@ 2006-10-08 22:22 ` Bart Schaefer
  2006-10-08 23:37   ` denis
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 2006-10-08 22:22 UTC (permalink / raw)
  To: zsh-workers

On Oct 8, 11:27pm, denis wrote:
}
} according to the manpage (zshcontrib) you could reset all
} attributes using the color 'none', but this doesn't work.

You're misreading the documentation.

The second paragraph under "colors" in zshcontrib is providing
background material on ANSI terminal color attributes.  It is NOT
talking about the contents of the arrays or how you use them.  Note
that it begins:  "The eight base colors are: black, red, green,
yellow, blue, magenta, cyan, and white."

Later, under the description of the "fg" array, it says: "Map the
eight basic color names ...".  Notice that "none" is NOT one of the
eight basic color names; there is no $fg[none].

There is, however, $reset_color, which is what you want here.  If you
look at the assignment of $reset_color in the "colors" function def'n,
you'll see that it uses $color[none].

   echo "$fg[red]this is red${reset_color}this is no longer red"

It is true that $fg[default] is undocumented.  The effect of the ANSI
"default color" value is apparently supposed to be to reset the color
without changing other attributes, whereas $reset_color resets all the
attributes.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-10-08 23:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-08 21:27 [bug] color none vs. default denis
     [not found] <200610082129.k98LTxIq003101@torgo.zanshin.com>
2006-10-08 22:22 ` Bart Schaefer
2006-10-08 23:37   ` denis

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).