Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Sep 1999 20:33:34 -0700 (PDT)
From:      dot@dotat.at
To:        freebsd-gnats-submit@freebsd.org
Subject:   gnu/13989: SIGWINCH corrupts the display of a multiline readline prompt with invisible characters
Message-ID:  <19990927033334.6F11614DED@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 26 20:40:00 PDT 1999
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990927033334.6F11614DED>