From owner-freebsd-bugs Sun Sep 26 20:40: 3 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id EBEB915730 for ; Sun, 26 Sep 1999 20:40:00 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id UAA45992; Sun, 26 Sep 1999 20:40:00 -0700 (PDT) (envelope-from gnats@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 To: freebsd-gnats-submit@freebsd.org X-Send-Pr-Version: www-1.0 Subject: gnu/13989: SIGWINCH corrupts the display of a multiline readline prompt with invisible characters Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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