Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 May 1998 20:00:33 +0200 (CEST)
From:      Leif Neland <leifn@internet.dk>
To:        Brendan Kosowski <brendan@bmkind.lnk.telstra.net>
Cc:        FreeBSD Questions <freebsd-questions@FreeBSD.ORG>
Subject:   Re: Console color
Message-ID:  <Pine.BSF.3.96.980517194633.3422A-100000@darla.swimsuit.internet.dk>
In-Reply-To: <Pine.LNX.3.96.980517194130.1538A-100000@bmkind.lnk.telstra.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 17 May 1998, Brendan Kosowski wrote:

> 
> Does anyone out there know how to change the console text color from grey
> to another color ( green or yellow ) which is easier on the eyes.
> 
You can change some constants in syscons.c:
<CUT>
static default_attr user_default = {
    (FG_LIGHTGREY | BG_BLACK) << 8,
    (FG_BLACK | BG_LIGHTGREY) << 8
};

static default_attr kernel_default = {
    (FG_WHITE | BG_BLACK) << 8,
    (FG_BLACK | BG_LIGHTGREY) << 8
};
</CUT>

Or use the ansi controle sequence to change colours:
set your prompt to:
"\e[33;41;1m \$ "
 \e is escape
 [  is [   :-)
 3x is foreground colour (33 is foreground green)
 4x is background colour (41 is background red)
 1  is high intensity
 m  is end of escape sequence.

Or send the escape sequense from an echo:

echo -e "\e[33;41m"

Only the first method will work "into programs"; if a program sends a
"clear screen" command, the colours will be reset into the default in
syscons.c


Leif Neland
leifn@internet.dk



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.980517194633.3422A-100000>