[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Colorized Prompts Problem



On 5/4/2015 7:57 AM, Thomas H. George wrote:
On Mon, May 04, 2015 at 06:54:40AM +0000, Bonno Bloksma wrote:
Hi,

I entered the following in .bashrc

    PS1='\033[01;33m\h:\w\$ \033[00m'

to colorize the prompt (very handy to find the prompt when a command
fills the console screen with lines of text)

The only problem occurs when the next entry is more than one line.  In that
case the entry wraps around without moving to a new line.
I had the same problem using the prompt I found at first, I think it is the same you are using. It seems there is a problem in closing the ANSI code string.
Someone else gave me this:
   PS1='\[\e[0;31m\]${debian_chroot:+($debian_chroot)}\h:\w\$\[\e[m\] '
This does not have the problem, I have been using this now for over a year, no problems at all.

Bonno Bloksma

Thank you, this works while nothing else did.  The sequences to start
and end coloring are different and the colors are different too.  In the
prompt I was initially using 33 resulted in a bright yellow prompt.
With this prompt 33 results in a dull rust color prompt. No matter, it
works.

The bright yellow is the bold version of that color. The "1" causes it to be bold, so just change the 0;33m to 1;33m.


Reply to: