bug-bash
[Top][All Lists]
Advanced

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

Re: all invisible characters are attributed to the first line


From: Chet Ramey
Subject: Re: all invisible characters are attributed to the first line
Date: Mon, 2 Aug 2004 17:13:29 -0400

> Machine Type: i686-pc-linux-gnu
> 
> Bash Version: 3.0
> Patch Level: 0
> Release Status: release
> 
> Description:
>       When invisible characters appear in PS1 at a point past the
>       screenwidth, they are nonetheless attributed to the first
>       line.  The result is that bash will incorrectly wrap that many
>       characters.
> 
> Repeat-By:
>       Assuming a terminal width of 80 characters, the following will
>       demonstrate the problem:
>           # 120 characters is sufficient to demonstrate, then an invisible 
> sequence
>           
> PS1='123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\[\033[0m\]'

Thanks for the report.

I haven't looked closely at this yet, but in looking at the proposed
patch I can't see how this will change anything.  Even if the
offending statement is executed only after a visible character is
processed, it will still perform far more assignments than wanted.  As
long as there are visible characters after invisible ones, the wrong
value will still be assigned to invfl. 

What you want is to ensure that the assignment is only executed once, the
first time the character count exceeds the screen width.  A flag variable
seems the most appropriate way to do that.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
                                                Live...Laugh...Love
Chet Ramey, ITS, CWRU    chet@po.cwru.edu    http://tiswww.tis.cwru.edu/~chet/




reply via email to

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