vi editing mode + color prompt = trouble?

2008-12-09 Thread Halim Issa
On bash 3.2 patchlevel 048 (and earlier) there appears to be problems in vi 
mode and prompts containing escape characters (such as to get bold text).

To reproduce:
Enter vi editing mode set -o vi

Set the following prompt:
export PS1="[\!] [EMAIL PROTECTED]:\w>"

Type "one two three four five six seven eight" press ESCape and 7 B to go 
seven words back. This takes me right in the middle of the prompt while 
displaying (args:7) on the prompt. Once it removes the (args:7) info, ie when 
I press the "B", the cursor location is messed up and I end up in the middle 
of the prompt, instead of at the word "two" where I should be.

Ofcourse it doesn't have to be 7 B, any numbered vi command that displays the 
(args:) feedback will cause things to go wrong with this prompt...

Thanks for reading. Please advise if I chose the wrong channel of reporting.




Re: vi editing mode + color prompt = trouble?

2008-12-20 Thread Halim Issa
Thanks for replying!

On Saturday 13 December 2008 04:38:43 Chet Ramey wrote:
> Halim Issa wrote:
> > Type "one two three four five six seven eight" press ESCape and 7 B to go
> > seven words back. This takes me right in the middle of the prompt while
> > displaying (args:7) on the prompt. Once it removes the (args:7) info, ie
> > when I press the "B", the cursor location is messed up and I end up in
> > the middle of the prompt, instead of at the word "two" where I should be.
>
> I can't reproduce this with xterm, aterm, or Terminal on Mac OS X with
> bash-3.2.48.

I've tried it some more, and have come across the same problem on both CentOS 
and Slackware, who have rather different systems. Both relate only to using 
escape sequences to change intensity only, not the full ansi-code for blink 
and colours and such...

I have also tried in both xterm and konsole (KDE). If you need my .bashrc to 
check, please let me know. Since I've now seen this on multiple machines with 
the same result, maybe I'm to blame somewhere, but you've already seen the 
prompt command  - nothing overly special except the ansi bold escape...

> I have made display fixes for possibly-related problems displaying numeric
> arguments; maybe those will fix your problem.  They will come out with
> bash-4.0.

Great - I'm staying tuned for it!

On a non-related note - there are still rumors around that bash 3.2 has some 
problems with `running backtick commands` compared to the new $(way to do it) 
- isn't this fixed in the first few patches of 3.2, or are there still 
compatibility issues from 3.1 to 3.2, and will there be similar changes moving 
onwards from 3.x to 4.0 ?

Thanks again!