[darcs-users] Re: Pipes, pagers and pretty colors

David Roundy droundy at abridgegame.org
Sun Apr 3 13:25:43 UTC 2005


On Sat, Apr 02, 2005 at 03:06:20PM -0800, Michael G Schwern wrote:
> To sum up the argument against colors...

I find that colors stand out better than bold or underline.  Actually, when
darcs colors things, it also emboldens them, since non-bold colors often
aren't so easy to read.  But I find the combination very nice.

> * Some people are color blind

I think color blind people are usually still able (depending on the variety
of color blindness) to distinguish colors from black.  We *certainly*
shouldn't have any important meaning encoded with color, so the color blind
will simply have a somewhat less contrast.

> * Many terminals can't handle ANSI color

I believe this is already handled by the curses call to find out how many
colors the terminal can handle.

> * Even if they can its hard to detect if they can

I'd say that's up to the user to configure.  If a user cares about seeing
colors, he or she will make sure to use a terminal (or configure the
terminal) so that colors are visible.

> * Many pagers can't handle ANSI color even with special flags

By default (except for the bug reported regarding hex escape codes) darcs
doesn't dump color to pagers.  If and when it does, this will be
configurable.  I guess if darcs by default were to dump to $PAGER, then
this could become an issue.  But even in that case, darcs will still need
to support cases where $PAGER isn't defined (e.g. windows).

> * What value is it adding above and beyond bold and underline?

It stands out more, at least to my eyes.  And it gives another dimension
(that of hue) to highlight different things differently.  When I first
started working on conflictors (the new conflict handling code) the
conflictors were highlighted in blue like the hunks.  I found it very hard
to read, since a confictor can contain within it several hunks.  When I
changed the conflictors to red, I found it much easier to read the
resulting patches.  Admittedly, hopefully noone else is often going to be
reading conflictors very often, but the point is that the color made things
easier to read.

> So it boils down to this:  color is a pain in the ass to get right and is 
> it really adding anything over bold and underline?

I do agree that it would be nice to also support--either in combination or
as an alternative--bold and underline.

> If you really want color maybe there can be a global --color switch which
> all commands respect and which can be turned on in your .darcs file.  But
> for a default, bold and underline seem to have the best and safest bang for 
> the buck.

I agree that a global switch would be good, but would prefer it to be an
environment variable.  I prefer environment variables for things that I
can't imagine usefully wanting to change between calls to darcs, which
keeps the darcs command --help list shorter (at the cost of requiring users
to read the "Configuring darcs" section of the manual to find out what
environment variables they can define).
-- 
David Roundy
http://www.darcs.net




More information about the darcs-users mailing list