delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/02/27/09:48:52

X-Spam-Check-By: sourceware.org
From: ericblake AT comcast DOT net (Eric Blake)
To: Koen Claessen <koen AT chalmers DOT se>
Cc: bug-bash AT gnu DOT org, cygwin AT cygwin DOT com
Subject: Re: incorrect handling of invisible characters in prompt string
Date: Mon, 27 Feb 2006 14:48:37 +0000
Message-Id: <022720061448.18320.440311450003DE7B0000479022007503300A050E040D0C079D0A@comcast.net>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

[Please use mailing lists instead of sending private mail
to random developers - I don't know whether you
intended this as a question about bash proper or
about the cygwin port of bash, so I have cross-posted
my reply]

> Hi Eric,
> 
> I found the following message (from July 2005) by you on the cygwin 
> mailing list:
> 
> http://cygwin.com/ml/cygwin/2005-07/msg00659.html
> 
> As you probably know, that bug is still there :-)

Yes, readline 5.1 still mishandles invisible characters present
in one-line prompts when compiled for multibyte support, at
least on cygwin, and I still don't know a root cause.

> 
> Do you have any info on bug status, workarounds, etc.? I would be happy 
> for any kind of advice.

If you are using the cygwin packaging of readline 5.1, I use
the following hack to force the redisplay of the entire
line in question (obviously not a correct patch, but at
least a workaround to avoid the display bug):

diff -urN -x .build -x .inst -x .sinst readline-5.0-orig/display.c readline-5.0/
display.c
--- readline-5.0-orig/display.c 2005-07-28 21:58:19.451125000 -0600
+++ readline-5.0/display.c      2005-07-28 21:55:55.779250000 -0600
@@ -286,7 +286,10 @@
   if (lp)
     *lp = rl;
   if (lip)
-    *lip = last;
+    /* Hack: faking that \[\] was always the last part of the prompt reduces
+       (but does not completely solve) double character prompt display bugs. */
+    *lip = r - ret;
+/*    *lip = last; */
   if (niflp)
     *niflp = invfl;
   if  (vlp)

-- 
Eric Blake
volunteer cygwin bash maintainer

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019