ive got a semi-custom (took most of it from an online example) bash prompt - but im having a bit of trouble with it wrapping incorrectly.
it wraps to the next line at the correct character - then i can type 1 more character, and the cursor goes to the beginning of the wrapped line and starts overwriting things there....
then if i hit delete enough it tries to wrap back but ends up displaying an extra line .... basically just very odd stuff
so my guess is im missing some escaping character stuff here - but i cant see where so extra pairs of eyes would be appreciated
here's the code:
Code:
GRAD1=`tty|cut -d/ -f3`
COLOR1="\[\033[0;36m\]"
COLOR2="\[\033[1;36m\]"
COLOR3="\[\033[1;30m\]"
COLOR4="\[\033[0m\]"
PS1="$COLOR3\[\\033(0lw\]\[\\033(B\]$COLOR1\[\\033(0q\]\[\\033(B\]$COLOR2($COLOR1\u$COLOR3@$COLOR1\h$COLOR2)$COLOR1\[\\033(0q\]\[\\03(B\]$COLOR2($COLOR1\#$COLOR3/$COLOR1$GRAD1$COLOR2)$COLOR1\[\\033(0q\]\[\\033(B\]$COLOR2($COLOR1\$(date +%I:%M%P)$COLOR3:$COLOR1\$(date +%m/%d/%y)$COLOR2)$COLOR1-$COLOR3-$COLOR4\n$COLOR3\[\\033(0mv\]\[\\033(B\]$COLOR1-$COLOR2($COLOR1\$$COLOR3:$COLOR1\w$COLOR2)$COLOR1-$COLOR3-$COLOR4 "
i do realize that there's a useless $COLOR4 at the end of the first line (right before the \n) but i'd like to leave this untouched until i can track down the weird wrapping problem
thanks
edit: here's a version of ps1 without any $color entries - might be easier to follow
Code:
PS1="\[\\033(0lw\]\[\\033(B\]\[\\033(0q\]\[\\033(B\](\u@\h)\[\\033(0q\]\[\\03(B\](\#/$GRAD1)\[\\033(0q\]\[\\033(B\](\$(date +%I:%M%P):\$(date +%m/%d/%y))--\n\[\\033(0mv\]\[\\033(B\]-(\$:\w)-- "