From nobody@FreeBSD.ORG Sun Sep 26 20:33:34 1999
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 6F11614DED; Sun, 26 Sep 1999 20:33:34 -0700 (PDT)
Message-Id: <19990927033334.6F11614DED@hub.freebsd.org>
Date: Sun, 26 Sep 1999 20:33:34 -0700 (PDT)
From: dot@dotat.at
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@freebsd.org
Subject: SIGWINCH corrupts the display of a multiline readline prompt with invisible characters
X-Send-Pr-Version: www-1.0

>Number:         13989
>Category:       gnu
>Synopsis:       SIGWINCH corrupts the display of a multiline readline prompt with invisible characters
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 26 20:40:00 PDT 1999
>Closed-Date:    Tue Oct 10 14:36:52 PDT 2000
>Last-Modified:  Tue Oct 10 14:37:22 PDT 2000
>Originator:     Tony Finch
>Release:        3.3-RC-19990916
>Organization:
Demon Internet
>Environment:
FreeBSD fanf.eng.demon.net 3.3-RC-19990916 FreeBSD 3.3-RC-19990916 #3: Thu Sep 16 03:06:33 BST 1999     root@fanf.eng.demon.net:/usr/src/sys/compile/DELL-PREC410  i386

>Description:
If you are using libreadline with a multiline prompt containing invisible
characters on the last line, then when the program receives SIGWINCH and
redraws the last line of the prompt it outputs spurious ^A and ^B
character(s).

>How-To-Repeat:
run bash in an xterm
set PS1 to 'line one\n\[\e[1m\]line two\[\e[0m\] '
you will then have a two line prompt with invisible characters on the second line
change the size of the xterm; the second line will be bracketed with
a diamond-dither pair
>Fix:
I think the first patch is correct; the second one *might* catch more
cases, but requires a bit more work at run time. 


--- /usr/src/contrib/libreadline/display.c.orig	Mon Sep 27 04:30:07 1999
+++ /usr/src/contrib/libreadline/display.c	Mon Sep 27 04:30:07 1999
@@ -1540,7 +1540,7 @@
       oldp = rl_display_prompt;
       oldl = local_prompt;
       oldlprefix = local_prompt_prefix;
-      rl_display_prompt = ++t;
+      rl_display_prompt = oldl ? oldl : ++t;
       local_prompt = local_prompt_prefix = (char *)NULL;
       rl_forced_update_display ();
       rl_display_prompt = oldp;


--- /usr/src/contrib/libreadline/display.c.orig	Mon Sep 27 04:30:07 1999
+++ /usr/src/contrib/libreadline/display.c	Mon Sep 27 04:30:07 1999
@@ -1540,9 +1540,10 @@
       oldp = rl_display_prompt;
       oldl = local_prompt;
       oldlprefix = local_prompt_prefix;
-      rl_display_prompt = ++t;
+      rl_display_prompt = expand_prompt(++t);
       local_prompt = local_prompt_prefix = (char *)NULL;
       rl_forced_update_display ();
+      free(rl_display_prompt);
       rl_display_prompt = oldp;
       local_prompt = oldl;
       local_prompt_prefix = oldlprefix;


>Release-Note:
>Audit-Trail:

From: Tony Finch <dot@dotat.at>
To: freebsd-gnats-submit@freebsd.org
Cc: Tony Finch <dot@dotat.at>
Subject: Re: gnu/13989: SIGWINCH corrupts the display of a multiline readline prompt with invisible characters
Date: Mon, 09 Oct 2000 14:01:03 +0000

 This has been fixed in a more recent version of readline, so the PR
 can be closed.
 
 Tony.
 -- 
 en oeccget g mtcaa    f.a.n.finch
 v spdlkishrhtewe y    dot@dotat.at
 eatp o v eiti i d.    fanf@covalent.net
 
State-Changed-From-To: open->closed 
State-Changed-By: johan 
State-Changed-When: Tue Oct 10 14:36:52 PDT 2000 
State-Changed-Why:  
Closed at originators request. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=13989 
>Unformatted:
