Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 07 Oct 2001 18:48:28 -0700
From:      "Charles Burns" <burnscharlesn@hotmail.com>
To:        questions@freebsd.org
Subject:   Color BASH prompt question
Message-ID:  <F4olgfdUDIpAoFg6YhS0001443a@hotmail.com>

next in thread | raw e-mail | index | archive | help
When using ANSI color codes to color the BASh prompt ("^[[1;37m", for 
example), BASh seems to think that the codes are actual displayed characters 
and shortens the # of characters that can be typed into the first line of 
the command prompt accordingly.

For example, with no color codes at 80x25, you can type a number of 
characters equal to 80 minus the # of characters in the prompt. A prompt of:
"bash-2.05# " for example would allow typing of 69 characters without BASH 
putting further characters on the next line.

With several color code sequences, this makes commands trail off after 
typing about 10 characters, which is very irritating.
A solution would be to have a 2-line command prompt, but that would be ... 
wrong somehow.

Any solutions to this would be appreciated... Not a critically important 
problem, but I know of several people annoyed by this.

I could probably have BASh return to the beginning of the line, then add a # 
of non-destructive spaces equal to the real prompt length, but having an 
esoteric shell script just to have a color prompt seems silly.

Thnks ahead of time


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


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?F4olgfdUDIpAoFg6YhS0001443a>