Well... I love console... but with colors!!!
Give me some time to read "the other" man pages (not man bash, of
course...) :))
One more question -maybe the answer is in your reply but I lost it, then
sorry-:
If ";1m" is bold ";5m" is blinking and ";m" is reset: Which is NORMAL
TEXT? Because ";0m" or ";m" doesn't let me colorize just text, not
background!!! Is it ";2m" as my tests seem to be?
Thx again for yur answer:
--
J. M. Albores

[EMAIL PROTECTED] wrote:
> 
> On Sat, 18 Dec 1999, J. M. Albores wrote:
> 
> > It can be read in Configuration-HOWTO that bash's prompt can be colored
> > just adding some lines to "/etc/bashrc":
> >
> >   ---------------------------------------------------
> >   COLOUR=45
> >   if [ $USER = 'root' ] ; then
> >     COLOUR=41  # red
> >     PATH="$PATH:/usr/local/bin"
> >   fi
> >
> >   ESC="\033"
> >   STYLE=';1m' # bold; choose which one to use
> >   # STYLE='m' # plain
> >   PS1="\[$ESC[$COLOUR;37$STYLE\]$USER:\[$ESC[37;40$STYLE\]\w\\$ "
> >   PS2="> "
> >   -----------------------------------------
> >
> > Several questions about it:
> >
> > 1. What is this "\033\" for and what does this mean?
> > I read something in Keyboard-and-Console-HOWTO but I understand nothing
> > about "stty -sane ...etc" or unimap codes... Don't know what that mean.
> 
> \033 is a way to enter the ASCII character escape (0x1b, octal 033,
> control-[) using bash's excape character \.  See man bash, THE WHOLE
> +*!! THING.  Oh, all right, you may scan it for strings you might be
> interested in with the command /<string>, and break for meals and naps
> :-).  I like man bash, but it is one whacking big man page.
> 
> man ascii is shorter, and might be more help.
> >
> > 2. This issue works with COLOUR within a range from 40-47: as I
> > understand from /etc/DIR_COLORS these are background colors, if
> > dircolors is related to this. But doesn't work properly with colours
> > from 30-37 which are "Text" color codes if I change ';1m' for 'm' in
> > STYLE...
> >
> > 3. Cannot found in DIR_COLORS info what this thing of: "STYLE" means. I
> > mean... color 30 is black text... but what does it mean ';1m' or 'm'
> > mentioned as $STYLE ???
> 
> It isn't used in DIR_COLORS.  it is just a bash variable used in that
> little script snippet at the end of the escape sequence.  If you are
> going to hack on this script you are likely to provoke some little bugs
> in it.  1 is the ECMA-48 command to set bold attribute, so ;1m in STYLE
> sets bold attribute and ends the sequence.  m just ends the sequence
> without changing anything.  I don't like it that STYLE is at the
> beginning and end of the PS1 string, so the attribute is propagated
> beyond the prompt, so I have changed my copy.
> 
> > Anybody who tries to change colors from 40-47 with the 'm' style can
> see
> > it doesn't work properly.
> 
> So what is wrong with white text on a white background?  :-)
> If you  don't like that, try 45 with ;5m for STYLE and see if you like
> that better.
> 
> Is the above maybe a typo for 30-37?  The script hardcodes the
> foreground color to white, 37, which it gives after COLOUR.
> 
> > Where can I find info?
> 
> man console_codes, the section on ECMA-48 Set Graphics Rendition.
> >
> > I just want to have a full customizable bash prompt in order to impress
> > my Windoze friends with Linux beauties (and because I like it)!!!
> > ;)
> >
> > --
> > J. M. Albores
> >
> Here is a version of the script I like a little better.  You will still
> need to read man console_codes to hack it very well.  Since it is
> setting the environment, to see what it does, use the bash builtin
> command source.  If you named the script ./color,
> 
> source ./color
> 
> If $USER is blank, try uncommenting the USER=$LOGNAME.
> 
> Lawson
> 
>           >< Microsoft free environment
> 
> This mail client runs on Wine.  Your mileage may vary.
> 
> #!/bin/sh
> #  USER=$LOGNAME
>   COLOUR=47     #background color for prompt
>   FG=35          # foreground
>   if [ 'root' = $USER ];  then
>     COLOUR=41  # red
>     PATH="$PATH:/usr/local/bin"
>   fi
>   RESET=';0m'
>   ESC="\033"
>   STYLE=';5m' # attribute; 1 is bold, 5 blink....
>   PS1="\[$ESC[$COLOUR;$FG$STYLE\]$USER:\[$ESC[$FG;40$RESET\]\w\\$ "
>   PS2="> "
> 
> ___________________________________________________________________
> Why pay more to get Web access?
> Try Juno for FREE -- then it's just $9.95/month if you act NOW!
> Get your free software today: http://dl.www.juno.com/dynoget/tagj.

Reply via email to