From: Tyler Smith <tyler.smith@mail.mcgill.ca>
To: debian-user@lists.debian.org
Subject: bash prompt won't wrap properly
X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-26) on murphy.debian.org
X-Spam-Level:
X-Spam-Status: No, score=-1.3 required=4.0 tests=AWL,BAYES_20 autolearn=no
version=3.1.4
Organization: Business Internet
Hi,
I've modified my bash prompt to display the number of minutes of
battery time left. I use the following code in my .bashrc:
##########
alias bt="acpi | awk '{print \$5}' | awk -F : '{print \$1*60 + \$2}'"
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm)
PS1='\033[01;31m\]$(bt)\033[00m\]|\033[01;32m\]\u\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]-> '
;;
*)
PS1='\u:\W-> '
;;
esac
###########
This works as expected, except that now if I enter a line that is
longer than the screen width, instead of continuing on the *next* line
it continues on the *same* line, over-writing what is there. I can
still pass the line to bash, which interprets it correctly, but it is
confusing and pretty much impossible to edit. What did I do wrong?
Tyle