Current-Users archive

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

Re: atf for libcurses

On Fri, Nov 05, 2010 at 10:21:55AM +1030, Brett Lymn wrote:
> smso^Crmso
> So, it enters standout, outputs a control-c and then exits standout.
> Why it does this I don't know, I have not dug into the curses code yet
> to find out what it thinks it is doing here.  It may be a quirk for
> some ancient terminal but it may be a bug.

I feel a bit vindicated now.  This is actually a bug in curses wgetch.
What it is doing is passing the keycode symbol to addch() to add it to
the screen.  For my test I put getch() into keypad mode and fed it the
escape sequence for the up arrow - getc() correctly returns the
keycode 0x103 (KEY_UP) what it also does is cast that keycode to a
chtype and called addch() as part of getch().  The chtype is a 16 bit
value, the upper 8 bits are the character attributes and the lower 8
are the character, 0x01 happens to be standout mode and 0x03 is ^C
hence the puzzling output.  This bug would have resulted in stray
standout characters being printed on the screen if certain function
keys were pressed in getch().

I have committed a fix for this.

Brett Lymn
The information contained in this email and any attached files is
confidential to BAE Systems Australia. If you are not the intended
recipient, any use, disclosure or copying of this email or any
attachments is expressly prohibited.  If you have received this email
in error, please notify us immediately. VIRUS: Every care has been
taken to ensure this email and its attachments are virus free,
however, any loss or damage incurred in using this email is not the
sender's responsibility.  It is your responsibility to ensure virus
checks are completed before installing any data sent in this email to
your computer."

Home | Main Index | Thread Index | Old Index