[ILUG] Colour in Prompt ($PS1)
kernel at tinet.ie
Fri Sep 10 21:30:38 IST 1999
From: zeris <zeris at zeris.net>
To: ilug at linux.ie <ilug at linux.ie>
Date: 07 September 1999 11:53
Subject: Re: [ILUG] Colour in Prompt ($PS1)
>* Breathnach, Proinnsias(Dublin) (breatpro at MLE.CO.UK) [990906 10:39]:
>there is a BASH prompt how to.
>but an example would be:
>export PS1='[\[\033[33m\]\u\[\033[39m\]@\[\033[32m\]\h\[\033[39m\] \w ]\$ '
>my non-root prompt,
>export PS1='[\[\033[31m\]\u\[\033[39m\]@\[\033[32m\]\h\[\033[39m\] \w ]\$ '
>would be a fetching red 'root' coloured.
>Irish Linux Users' Group: ilug at linux.ie
>http://www.linux.ie/mailman/listinfo/ilug for (un)subscription information.
>List maintainer: listmaster at linux.ie
just a bit of a followup really...
incidently, taken too far, this can really make to console look UGLY
anyway, basically there are further ways to wierdify your prompt...
using the example zeris gave...specifically the [31m\] type parts...which
control the colour and more - you can actually have three fields in this
taking the format:
various possibilities are as follows:
attribute colour foreground
0 none black 30
1 bold red 31
4 underline green 32
5 blink yellow 33
7 inverse blue 34
8 invisible magenta 35
anyway, that's it, don't have too much fun :)
More information about the ILUG