[Top][All Lists]

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

RE: [Bug-readline] nul's from tputs(called by rl_ding) when prefer_visib

From: McConnaughey, Bill
Subject: RE: [Bug-readline] nul's from tputs(called by rl_ding) when prefer_visible_bell is On
Date: Fri, 30 Apr 2010 09:19:29 -0500

From: Chet Ramey address@hidden
Sent: Thursday, April 29, 2010 9:49 PM
To: McConnaughey, Bill
Cc: address@hidden; address@hidden
Subject: Re: [Bug-readline] nul's from tputs(called by rl_ding) when 
prefer_visible_bell is On

On 4/28/10 4:47 PM, McConnaughey, Bill wrote:
> I made some additions to readline-6.1 in order to record what goes in and 
> out, so that I can
> debug a misbehaving graphical interface. The record reveals a probable bug, 
> but I don't know
> enough about curses to tell whether the bug is in there or in readline.
> Consistently seen pattern, when prefer-visible-bell is On
> Left column is from the log file made by readline with my changes; 
> explanations are added at the right
> i1 ^[                                   I pushed the cursor-left key
> i1 [
> i1 D
> o3 tputs[1](^H)                         readline emitted a backspace
> o1 ^H
> i1 ^[                                   I pushed the cursor-left key, but I 
> was already at the start of the line
> i1 [
> i1 D
> o10 tputs(^[[?5h^[[?5l$<200/>)          readline issued the visible bell 
> sequence via tputs in rl_ding
> o1 ^[
> o1 [
> o1 ?
> o1 5
> o1 h
> o1 ^[
> o1 [
> o1 ?
> o1 5
> o1 l
> o1 ^@                                   and it is followed by exactly 853 
> nuls's
> o1 ^@
> o1 ^@
> o1 ^@
> .....
> o1 ^@

You can test this fairly easily.  Run gdb on your program (from another
terminal using `attach', if necessary), set a breakpoint in rl_ding,
wait for it to hit, and examine the value of _rl_visible_bell.  If it
doesn't include 853 NUL characters, the problem must be tputs padding
the output.


Thanks for the hint, Chet. I tried it and got

(gdb) p _rl_visible_bell
$1= 0xb7e00637 "\33[?5h\33[?5l$<200/>"

which is completely consistent with the record from my modified readline. I 
made a guess and changed the '$' (_rl_visible_bell[10]) to nul. Then the 
terminal blinked in the same manner as before, but the 853 nul's were not 
emitted. So I still don't know where the bug is (or whether it is deliberate 
padding), but I can easily patch it.

The materials in this message are private and may contain Protected Healthcare 
Information or other information of a sensitive nature. If you are not the 
intended recipient, be advised that any unauthorized use, disclosure, copying 
or the taking of any action in reliance on the contents of this information is 
strictly prohibited. If you have received this email in error, please 
immediately notify the sender via telephone or return mail.

reply via email to

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