Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 May 1996 17:32:54 +0000 (GMT)
From:      Gabor Zahemszky <zgabor@CoDe.hu>
To:        Francisco.Reyes@i-2000.com
Cc:        freebsd-questions@freebsd.org
Subject:   Re: colored prompts in BASH
Message-ID:  <199605131732.RAA01236@CoDe.CoDe.hu>
In-Reply-To: <199605130347.XAA12617@i-2000.com> from "Francisco Reyes" at May 12, 96 11:46:11 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> At work there is one Linux computer and the bash shell there
> has color prompts for different types of files. I have FreeBSD
> at home and I would like to have colored prompts.

Hm.  For me, it looks like this is not one question, but two.

1) color prompt in bash:  you have to send some special escape sequences in
the prompt with which you can change colors on a terminal.  On a
vt100-compatible (with colors), it would be something that <ESC>[27;34m
the <ESC> is an ESCAPE character (0x1b - I think), the [ is a [, and the
two numbers are the foreground/background colours of the screen (or maybe the
other direction).  The m is an m.  And yes, the ; is a ;. You have to look
into a vtX programming guide to know what number is what colour.  Or try to
set the PS1 variable on the FreeBSD machine to the same, as in the Linux.
(On Linux,
echo "$PS1"
and on FBSD:
PS1="the-string-you-got-from-the-echo"
).

2) color prompts for different types of file: it looks, that you used the
color-ls command (which is the default in Linux, as I know), this is a
special type of the ls command, which is on ports/packages collection of
fbsd, with some name like, color-ls.

If it is not your problem, please try to tell to me: when did you get a
prompt from your Linux/bash shell for filename?  I think, the shell prompt is
different from the ls list.

(Waiter, I need a bottle of wine!  Eg, a Gordon Bleu, or maybe a ham&eggs!)

> I have searched in the Bash FAQ and did not find anything
> regarding colored prompts. I tried the man pages also.

And anything about prompts?

> Is this a feature available to Linux only?

Don't think so.

> If this is a Linux feature would it be too difficult to introduce to
> FreeBSD?

No.  I think somebody don't know the difference between prompt, and list.
But!  If I know it wrong, don't hesitate, but send me more info about your
problem.  At work there is a Linux machine with bash and color-ls, at home
there is FreeBSD with original ls, so I could try to isolate your problem.

-- 
	Gabor Zahemszky <zgabor@CoDe.hu>

-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-
Earth is the cradle of human sense, but you can't stay in the cradle forever.
						Tsiolkovsky



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199605131732.RAA01236>