delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/10/16/23:48:09

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <43531EEF.D590C502@dessent.net>
Date: Sun, 16 Oct 2005 20:47:59 -0700
From: Brian Dessent <brian AT dessent DOT net>
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Customising prompt
References: <88ACCA0E0A7A914DAFBA3918021605D24E3FCC AT WPEXCH08 DOT colesmyer DOT ad DOT cmltd DOT net DOT au>
X-IsSubscribed: yes
Reply-To: cygwin AT cygwin DOT com

Robert Bram wrote:

> The issue is this: the I am getting black text on grey background - why is this? I thought "\e[30;47m " means black text on white background. That is what I understood from this page:
> http://www.pantz.org/scripting/shell/colorterm.shtml

The way that the ANSI escape sequences work is that there are 8 colors
and 2 intensities for each.  The 30 through 37 and 40 through 47 codes
set the FG and BG to one of those 8 colors.  So 47 really is gray,
because it's the low-intensity version of that color.  If you want white
you have to switch to the high-intensity version.

But, back in the old DOS days (early/mid 80s) the CGA adapter used the
intensity bit of the background color nibble to designate blinking,
which meant that you were limited to the 8 lower intensity colors for
the background of text.  But if I recall correctly you could toggle
this, and sacrifice the ability to have blinking text for the ability to
use the high-intensity background colors.

Anyway this is a long-winded way of saying that you need to include the
"blink" attribute in your ANSI sequence if you want the background to be
white.  Try "\e[5;30;47m".

However, I suggest that instead of setting the overall text color of the
console with the prompt, that you set it when the console is created. 
If you are using CMD.EXE you need to go to the properties of the
shortcut and mess with the "Colors" tab.  If you're using rxvt then you
can set it using command line parameters and/or resources.  If you do it
this way, the default colors of the console are set for you without
having to do it with the prompt.  For example, if you run vim then it
will go back to the default color set because it's not using the colors
in the prompt.  If you set the color of the console itself, you
shouldn't have this problem.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019