Re: How do I turn ANSI-terminal colourising off?

Jan Wielemaker <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
On 08/13/2013 05:53 AM, Richard A. O'Keefe wrote:
> I'm running SWI Prolog version 6.5.0 on a Macintosh running OS X 10.7.5.
> I'm doing this through a Terminal, using black text on a hospital green
> background.  XPCE is not involved, nor Emacs of any flavour.  This is
> just plain old terminal interaction.
> 
> ?- [library(lists)].                                        <- all black
> %  library(pairs) compiled into pairs 0.00 sec, 22 clauses  <- green on green
> % library(lists) compiled into lists 0.00 sec, 122 clauses  <- green on green
> true.                                                       <- purple
> 
> Having the information lines come out in a moderately saturated
> green on a slightly less saturated green background is as helpful,
> and purple on green as horrible, as they sound.
> 
> It's sending
> 	<ESC>[32m  green stuff <NL>
>         <ESC>[0m<ESC>[32m green stuff <NL>
> 	<ESC>[0m<ESC>[1m purple stuff.<ESC>[0m<NL>
> 
> 
> I've just been looking in http://www.swi-prolog.org/pldoc/refman/
> for some advice about this.  The only mention of "terminal" I can find
> is section 4.33 Terminal Control, which has nothing to say about it,
> and as for "Colour", it isn't there at all (even under Merkin speling).
> Section 4.36, User Top-Level Manipulation, is also silent.
> My despairing eye lighted on B.10, Readline Interaction, but there's
> nothing about colourising there either.  Using the search box to look
> for "terminal" or "colour" also got me nowhere.

There are two ways to control this.  Here are some entries:

  * message_property/2 allows changing the colour for message `types'.
  * The Prolog flag color_term can be set to `false`.  That is most
    likely your best option.

> (By the way, Section B.2, Global Cuts, seems to be describing what have
> long been known as >ancestral< cuts, or have I misunderstood?  That's
> what the undocumented Quintus operation was called, following Prologs
> that did document something of the sort.)

Thanks.  Synchronized.

> Whatever the default colours are, they should be chosen to *contrast*
> with the user's Terminal settings, and if it is impractical to detect
> that, the best default is no colouring.

I don't think there is a way to get this info.  Some emulators allow for
redefining the 16 ANSI colors, which might solve some of the problem, but
makes it impossible to guess the result of specifying colors.  That
suggests disabling.  But today, quite a few applications color by default
and I have the impression that most people like it.  Yes, it means that
color-blind people, people with specific color settings or those who
simply dislike colors must find the always application-specific way
to get rid of the colors or change them.  You'll always make some
people unhappy with whatever default preference you choose ...

	Cheers --- Jan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.