monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] Re: colored diffs [Was: [PATCH] parent selector 'p:


From: Ethan Blanton
Subject: Re: [Monotone-devel] Re: colored diffs [Was: [PATCH] parent selector 'p:xxx']
Date: Mon, 8 Oct 2007 17:46:28 -0400
User-agent: Mutt/1.5.13 (2006-08-11)

Zack Weinberg spake unto us the following wisdom:
> On 10/8/07, Lapo Luchini <address@hidden> wrote:
> > We could, in fact, add a --color option to "mtn diff" itself...
> [...]
> > Also "mtn log" and "mtn status" would have a big benefit from colors, in
> > fact. It could be nice to use them... should probably be off by default,
> > but turnable on by default using an hook or something.
> >
> > Does anyone object if I implement that? ;-)
> 
> It's a good idea but you need to be careful how you implement it.
> Hardwiring VT220 color control codes would be bad.  So would making us
> depend on ncurses.

ncurses is far less odious than boost -- most systems actually *have*
ncurses, and it doesn't kick compilation times into the stratosphere,
either.  ;-)  I agree that hardcoding escape sequences is a bad idea,
but I really think ncurses is the right answer.  Worst case scenario,
it could be compile-time optional, and color output could simply be
ommitted on systems without ncurses (does such a system exist?).

> I'd suggest a set of Lua hooks that know the necessary escape
> sequences for the most common TERM= settings (xterm, etc) and can
> query the 'tput' utility for less common ones.  You could also use
> this to get at the line-drawing characters for
> asciik...

Down this path lies madness.  You're reinventing terminfo.

Ethan

-- 
The laws that forbid the carrying of arms are laws [that have no remedy
for evils].  They disarm only those who are neither inclined nor
determined to commit crimes.
                -- Cesare Beccaria, "On Crimes and Punishments", 1764

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]