[Top][All Lists]

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

all invisible characters are attributed to the first line

From: agriffis
Subject: all invisible characters are attributed to the first line
Date: Mon, 2 Aug 2004 10:49:33 -0400

Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
-DHAVE_CONFIG_H  -I.  -I. -I./include -I./lib   -mcpu=athlon -O3 -pipe
uname output: Linux time.flatmonk.org 2.6.6-rc3 #1 Thu May 13 09:43:41 EDT 2004 
i686 AMD Athlon(tm) Processor AuthenticAMD GNU/Linux
Machine Type: i686-pc-linux-gnu

Bash Version: 3.0
Patch Level: 0
Release Status: release

        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

        Assuming a terminal width of 80 characters, the following will
        demonstrate the problem:
            # 120 characters is sufficient to demonstrate, then an invisible 

        Here is a patch to solve the problem.  Move the screenwidth test so
        that invfl (invisible characters on the first line) is only set
        immediately following the wrap.

--- bash-3.0/lib/readline/display.c.agriffis    2004-08-02 09:34:14.000000000 
+++ bash-3.0/lib/readline/display.c     2004-08-02 10:48:26.256360524 -0400
@@ -258,15 +258,16 @@
              *r++ = *p;
-             if (!ignoring)
-               rl++;                   /* visible length byte counter */
+             if (!ignoring) 
+               {
+                 rl++;                 /* visible length byte counter */
+                 if (rl >= _rl_screenwidth)
+                   invfl = ninvis;
+               }
                ninvis++;               /* invisible chars byte counter */
-         if (rl >= _rl_screenwidth)
-           invfl = ninvis;
          if (ignoring == 0)

reply via email to

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