Re: BUG: bash miscomputes size of prompt with ANSI escapes
From:
Paul D. Smith
Subject:
Re: BUG: bash miscomputes size of prompt with ANSI escapes
Date:
29 May 2001 12:22:34 -0400
User-agent:
Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7
%% bernie@codewiz.org (Bernardo Innocenti) writes:
bi> I was trying to get a colorful prompt for my shell, and I've
bi> tried this:
bi> PS1='\033[31m\u\033[36m@\033[33m\h\033[36m:\033[32m\w \033[36m\$ \033[37m'
bi> I got the wanted result, but apparently bash (version 2.05.5) uses a
bi> simple algorithm to compute the size of the prompt and so the cursor
bi> wraps too early.
See question E3 in the Bash FAQ, which, it so happens, was just posted
here yesterday (as it is every Monday).
--
-------------------------------------------------------------------------------
Paul D. Smith <psmith@gnu.org> Find some GNU make tips at:
http://www.gnu.orghttp://www.paulandlesley.org/gmake/
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist