bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wrong PS1 var width calculation


From: Cheng Renquan
Subject: Re: wrong PS1 var width calculation
Date: Mon, 8 Dec 2008 19:29:14 +0800

On Sun, Dec 7, 2008 at 8:33 AM, Chet Ramey <chet.ramey@case.edu> wrote:
> crquan@gmail.com wrote:
>
>> Bash Version: 3.2
>> Patch Level: 39
>> Release Status: release
>>
>> Description:
>>       I have set PS1 var to this:
>>       PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \[\e[1;33;40m\]$? 
>> \$\[\033[00m\] '
>>       according to bash manual, if I use character like \e[1;33;40m similar 
>> that
>>       doesn't occupy the width, use \[ and \] sequence to close them,
>>
>>       But unfourtunately, that seems not work.
>
> Can you give an example of what doesn't work?  It seemed OK for the basic
> stuff I tried on bash-3.2.48.

I need a screen record software to demo this bug, like this in a 80
character width terminal,

1. set PS1 to this and while I'm working in a very deep directory,

  PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \[\e[1;33;40m\]$? \$\[\033[00m\] '

2. like, 
/media/WD80G-HOME/gektop/tmp/author-package-cn/5.8/developerworks/my-article,
the result PS1 would be:
debra@debra 
/media/WD80G-HOME/gektop/tmp/author-package-cn/5.8/developerworks/my-article
0 $

3. it's longer than 80 chars width, and it will be displayed in two lines;

4. run a long line command, like this, it should be longer than 80 chars,
  echo 
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

5. the bug didn't appear till now,

6. but then you use <Up-Arrow>, C-a<Home>, C-e<End>, C-r (back
search), then C-a, C-e,
  mixture of <Left-Arrow>, <C-b>, <C-f>, <C-a>, <C-e>, <Home>, <End>,

  this bug will always reproduce,

7. the bug: the bash would not be able to locate the cursor to the
correct place,





debra@debra /media/WD80G-HOME/gektop/tmp/author-package-cn/5.8/developerworks/my
-article 0 $ s/media/WD80G-HOME/gektop/tmp/author-package-cn/5.8/developerworks/
tools/dwxmlxslt.sh ./index.xml
bash: 
s/media/WD80G-HOME/gektop/tmp/author-package-cn/5.8/developerworks/tools/dwxmlxslt.sh:
没有那个文件或目录                                  s
debra@debra /media/WD80G-HOME/gektop/tmp/author-package-cn/5.8/developerworks/ms
-article 127 $ s/media/WD80G-HOME/gektop/tmp/author-package-cn/5.s/developerwork
s/tools/dwxmlxslt.sh ./index.xml



BTW, someone know a good screen record software under Linux please
suggest it to me, I will record a video to show this bug clearly,
Thanks.


>
> Chet
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
>
> Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/
>



-- 
Cheng Renquan, Shenzhen, China
Marie von Ebner-Eschenbach  - "Even a stopped clock is right twice a day."

reply via email to

[Prev in Thread] Current Thread [Next in Thread]